Skip to content

Instantly share code, notes, and snippets.

@potomak
Created April 16, 2010 08:58
Show Gist options
  • Save potomak/368187 to your computer and use it in GitHub Desktop.
Save potomak/368187 to your computer and use it in GitHub Desktop.
var friends = document.getElementById("friends").getElementsByTagName("a")
var clickEvent = document.createEvent("MouseEvents");
clickEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
for(var i = 0; i < friends.length; i++) {friends[i].dispatchEvent(clickEvent);}
javascript:f=document.getElementById("friends").getElementsByTagName("li");for(var i in f){if(typeof(f[i]) === "object"){fs.click(f[i])}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment