javascript document click code example
Example 1: javascript trigger click on element
document.getElementById('myElementID').click();
Example 2: javascript click button by id
var button = document.getElementById("button");
button.click();
Example 3: javascript perform click
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}