I'm trying to use Firebug's command line to force a click event. This is as far as I've got and it's not very far.
document.getElementsByClassName('this_button').click();
Is is it possible to do what I want?
Thank you!
I'm trying to use Firebug's command line to force a click event. This is as far as I've got and it's not very far.
document.getElementsByClassName('this_button').click();
Is is it possible to do what I want?
Thank you!
I wonder why no one provided a solution so far. What you are searching for is this:
function simulateClick(element) {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
element.dispatchEvent(evt);
}
For more info see document.createEvent.
I didn't try it in other browsers, but at least it work for me in Firefox 18.0.1.