# Want to add button in inner node

**URL:** <https://forum.graphviz.org/t/want-to-add-button-in-inner-node/938>\
**Category:** Help\
**Created:** [December 8, 2021, 4:09pm UTC](https://forum.graphviz.org/t/want-to-add-button-in-inner-node/938 "2021-12-08T16:09:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [December 8, 2021, 7:52pm UTC](https://forum.graphviz.org/t/want-to-add-button-in-inner-node/938/2 "2021-12-08T19:52:08Z")

</div>

Short answer - Graphviz does not support this  
Longer answers, if you are willing to fiddle around:

- If you can use non-HTML records, Marc’s answer may work for you (uses class attribute): [Can I make a Digraph node interactive](https://forum.graphviz.org/t/can-i-make-a-digraph-node-interactive/503)
- If HTML-record shape is necessary, maybe this “kludge” will work:
  - use/abuse the **href** attribute to insert a version of your javascript code
  - postprocess the SVG output to fix the href-related text (using awk, python, sed, …)

```auto
digraph structs {
    node [shape=plaintext]
    struct3 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
  <TR>
    <TD ROWSPAN="3" href="!!alert('done')">hello<BR/>world</TD>
    <TD COLSPAN="3">b</TD>
    <TD ROWSPAN="3">g</TD>
    <TD ROWSPAN="3" href="!!alert('hello there')">h</TD>
  </TR>
</TABLE>>];
}

```

postprocessing:

```auto
gawk '
  /href="!!/{
    sub("><.*!!"," onclick=\"");
    sub(/xlink[^>]*/,"")
  }
 $0=="</a>"{next}
{print}' myfile.svg

```

Ugly, but seems to work

---

_[View the full topic](https://forum.graphviz.org/t/want-to-add-button-in-inner-node/938)._
