js edit button onclick code example
Example 1: edit onclick event
var submitButton = document.getElementById('submitButton');
submitButton.setAttribute('onclick', 'alert("hello");');
Example 2: javascript change button onclick
function Bar() {
document.getElementById("a").onclick = Foo();
}