Created
December 1, 2009 17:46
-
-
Save pwlin/246483 to your computer and use it in GitHub Desktop.
javascript dispatch mouse event
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
var button = document.evaluate("//button[text()='archive']", document, null, XPathResult.ANY_TYPE,null).iterateNext(); | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
button.dispatchEvent(evt); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment