Skip to content

Instantly share code, notes, and snippets.

@kartikmaji
Created February 27, 2015 10:38
Show Gist options
  • Select an option

  • Save kartikmaji/0b3e5777499ff2bb9b40 to your computer and use it in GitHub Desktop.

Select an option

Save kartikmaji/0b3e5777499ff2bb9b40 to your computer and use it in GitHub Desktop.
Clicks a button after t seconds
setTimeout(
function () {
//Depending on your button, you can also use getElementById
var x = document.getElementsByClassName("_42ft _4jy0 _11b _4jy3 _4jy1 selected _51sy");
x[0].click(); // x[0] gives us the first button with same class name
}, 3000 //timeout in milliseconds
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment