Skip to content

Instantly share code, notes, and snippets.

@skullface
Created December 19, 2023 17:00
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 skullface/a47286462ad6756cb82a0b13ffcd281d to your computer and use it in GitHub Desktop.
Save skullface/a47286462ad6756cb82a0b13ffcd281d to your computer and use it in GitHub Desktop.
Get the contents of all elements on a page with an HTML class of `class-name` within the browser console.
const el = document.querySelectorAll('.class-name');
for (i = 0; i < el.length; i++) {
console.log(el[i].innerText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment