Skip to content

Instantly share code, notes, and snippets.

@mdjaman
Forked from muhittin/strip_tags.js
Created September 26, 2016 12:24
Show Gist options
  • Save mdjaman/7ee6362a88f7fda67bb48e078016e9f7 to your computer and use it in GitHub Desktop.
Save mdjaman/7ee6362a88f7fda67bb48e078016e9f7 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