Created
March 16, 2010 17:00
-
-
Save benubois/334214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simulate a click event on the matched id | |
HTMLElement.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); | |
} | |
document.getElementById("id").click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment