should you use click on html or in js 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
}