Onclick to trigger a javascript function in html.A()

Any recommended resources for triggering a javascript onclick function in Dash?

Trying to build the equivalent of this…

a href="#" onclick=“show(‘mydiv’)”

Was researching html.A() and there doesn’t appear to be an onclick attribute for anchors in Dash? Or is there?

Would love to know.

1 Like

FYI, I’ll try to trigger through the URL

html.A(href=“javascript:show(‘mydiv’)”,‘test’)

This works. Hopes this helps anyone who has a similar issue.

3 Likes