Skip to content

Instantly share code, notes, and snippets.

@xoelop
Last active April 9, 2020 11:38
Show Gist options
  • Save xoelop/ee48624245ae763632fc18365c2ae534 to your computer and use it in GitHub Desktop.
Save xoelop/ee48624245ae763632fc18365c2ae534 to your computer and use it in GitHub Desktop.
JS code to click every element in a page with the same class name
var className = 'your-class-name'; // Replace your-class-name with the class name of the elements you want to click
var elements = Array.from(document.getElementsByClassName(className));
elements.map(x => x.click())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment