Skip to content

Instantly share code, notes, and snippets.

@JMalysiak
Created December 20, 2019 07:32
Show Gist options
  • Save JMalysiak/cfc3815c362c298abec172d230c99cf0 to your computer and use it in GitHub Desktop.
Save JMalysiak/cfc3815c362c298abec172d230c99cf0 to your computer and use it in GitHub Desktop.
Extracts content of HTML elements into a plain text
var selector = prompt('Insert CSS selector');
var elements = document.querySelectorAll(selector);
var text = '';
for (var i = 0; i < elements.length; i++) {
text += elements[i].innerHTML + "\n";
}
console.log(text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment