I’m trying to trigger this javascript with an onclick event in page element.
Here’s the javascript, which lives in a separate file in the assets folder:
function myFunction() {
alert(‘If you see this alert, then your custom JavaScript script has run!’);
document.getElementById(“atcharttype”).innerHTML = “Paragraph changed!”;
}
The page element is here:
dcc.Dropdown(options=dropdownlistcharts, style={'width':'220px'},id='atcharttype', onclick=, value=defaultchart),
], className="two columns"),
And what I’d like to add is the html equivalent of “onclick=myFunction()” to dcc.Dropdown.
Any ideas how to solve this?