how to change an html element onclick function using javascript code example
Example: javascript change button onclick
function Bar() {
document.getElementById("a").onclick = Foo();
}
function Bar() {
document.getElementById("a").onclick = Foo();
}