javascript btn.onclick function code example
Example 1: javascript button onclick programmatically
document.getElementById("myCheck").click();
Example 2: javascript button onclick
document.getElementById('button').onclick = function() {
alert("button was clicked");
};