Monday, November 08, 2004

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);
};

1 Comments:

Blogger Wedge said...

What is this, exactly?

3:13 pm  

Post a Comment

<< Home