Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

1 total

javascript dispatch mouse event

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


http://developer.mozilla.org/En/DOM:document.createEvent
1 total