Invaluable: attaching click() to a link in Mozilla
Just put this in the head...
HTMLAnchorElement.prototype.click = function () {
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
};
HTMLAnchorElement.prototype.click = function () {
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
};
1 Comments:
What is this, exactly?
Post a Comment
<< Home