calling click event from javascript code example
Example 1: js trigger click
var element = document.getElementById('element');
element.click();
Example 2: 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);
}
}