Skip to content

Instantly share code, notes, and snippets.

@thiagoeliasr
Forked from muhittin/strip_tags.js
Last active September 11, 2015 19:51
Show Gist options
  • Save thiagoeliasr/429502c5a59c2d5bac6f to your computer and use it in GitHub Desktop.
Save thiagoeliasr/429502c5a59c2d5bac6f to your computer and use it in GitHub Desktop.
strip_tags for Javascript
var text = '<div class="foo">bar</div>';
text.replace(/(<([^>]+)>)/ig,""); // Returns: bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment