simulate button click with javascript code example
Example 1: simulate a user click
// element.click simulates an user click
// doesn't work on <a> tags
document.getElementById("myCheck").click();
Example 2: javascript click button by id
var button = document.getElementById("button");
button.click();