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