Skip to content

Instantly share code, notes, and snippets.

@edwardbeckett
Created December 23, 2014 22:53
Show Gist options
  • Save edwardbeckett/4ebe5c2aae2d3df133ce to your computer and use it in GitHub Desktop.
Save edwardbeckett/4ebe5c2aae2d3df133ce to your computer and use it in GitHub Desktop.
Simple Method Replace Tags with Content
function stripTags( haystack) {
haystack = document.getElementsByTagName( haystack );
for( var i = 0; i < haystack.length; i++ ) {
haystack[i].innerHTML = haystack[i].textContent;
}
return haystack;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment