Skip to content

Instantly share code, notes, and snippets.

@lucasgameiro
Last active December 22, 2015 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasgameiro/6422708 to your computer and use it in GitHub Desktop.
Save lucasgameiro/6422708 to your computer and use it in GitHub Desktop.
simulate click javascript function
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0,
false, false, false, false, 0, null);
var el = document.getElementById('bigCookie');
window.setInterval(function click() {
el.dispatchEvent(evt);
},100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment