Joined February 2014
·
Dsp4cssd normal

Nafaa Boutefer

Jijel-Algeria
·
·

Posted to The single most useful thing in bash over 1 year ago

This is much better than Ctrl-R. Thank you very much..

Nice article, but to trigger registered events programatically on any DOM element, you can use the EventTarget.dispatchEvent method, like for example:
btn=document.getElementById('buttonx');
btn.dispatchEvent(new MouseEvent('click')); // this will make any click event listener on the button to be invoked
you can also use (new Event('click') simply)
But what you have said in this article still usefull if you want to see the list of event listeners. may be for debugging purpose.

Achievements
1 Karma
0 Total ProTip Views