I need to add an onclick event to an html button Iâve created, but while the standard dash html library includes buttons, it does not allow for âonclickâ as an argument. Where does dash compile the âpythonhtmlâ to actual html so I can go in and add this functionality. Iâve already added âonclickâ as an option in dash_html_components in metadeta.json and bundle.js
me too i donât know how can I add onclick trigger for calling a javascript function in plotly dash
Hello @adithiyan,
You can add a clientside callback,
app.clientside_callback(
âââ
function (n1) {
myfunction()
return window.dash_clientside.no_update
}âââ,
Output(âbuttonâ,ân_clicksâ),
Input(âbuttonâ,ân_clicksâ)
)
Where myfunction represents your targeted function.