create a button onclick javascript code example
Example 1: javascript button onclick programmatically
document.getElementById("myCheck").click();
Example 2: javascript onclick button
var button = document.querySelector('button');
button.onclick = function() {
//do stuff
}