I have a hyperlink in my page. I am trying to automate a number of clicks on the hyperlink for testing purposes. Is there any way you can simulate 50 clicks on the hyperlink
What
l.onclick();
does is exactly calling the onclick
function of l
, that is, if you have set one with l.onclick = myFunction;
. If you haven't set l.onclick
, it does nothing. In contrast,
l.click();
simulates a click and fires all event handlers, whether added with l.addEventHandler('click', myFunction);
, in HTML, or in any other way.