1//Your program can't find the function so do this.
2
3//You can assign the button onclick as an id.
4//then attach an eventListener on run time like this:
5
6<button id="btn">Click me!</button>
7
8var btn = document.getElementById("btn");
9btn.addEventListener("click", function() {
10 //Do something here
11}, false);