# Simple Javascript doesn't work in Dash...hmmm

**URL:** <https://community.plotly.com/t/simple-javascript-doesnt-work-in-dash-hmmm/45007>\
**Category:** Dash Python\
**Created:** [September 16, 2020, 10:16pm UTC](https://community.plotly.com/t/simple-javascript-doesnt-work-in-dash-hmmm/45007 "2020-09-16T22:16:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![plotly\_newbie\_2020](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@plotly\_newbie\_2020](https://community.plotly.com/u/plotly_newbie_2020)\
**Post date:** [September 16, 2020, 10:16pm UTC](https://community.plotly.com/t/simple-javascript-doesnt-work-in-dash-hmmm/45007/1 "2020-09-16T22:16:36Z")

</div>

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?
