Skip to content

Instantly share code, notes, and snippets.

@okovpashko
Created September 8, 2015 21:22
Show Gist options
  • Save okovpashko/8c26d9113a0b5e1046cd to your computer and use it in GitHub Desktop.
Save okovpashko/8c26d9113a0b5e1046cd to your computer and use it in GitHub Desktop.
Fill all text nodes on page with long text
var a,
w=document.createTreeWalker(document,NodeFilter.SHOW_TEXT);
while(a=w.nextNode()){
if(a.textContent.trim().length) {
a.textContent='Одиннадцатиклассница пошла посмотреть на достопримечательность, она шла долго, несколько строчек, пока не пришла';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment