html button onlick event js code example
Example: javascript button onclick
document.getElementById('button').onclick = function() {
alert("button was clicked");
};
document.getElementById('button').onclick = function() {
alert("button was clicked");
};