Skip to content

Instantly share code, notes, and snippets.

@johanfriis
Created May 18, 2013 20:59
Show Gist options
  • Select an option

  • Save johanfriis/5605775 to your computer and use it in GitHub Desktop.

Select an option

Save johanfriis/5605775 to your computer and use it in GitHub Desktop.
Stip html tags #snippet
stripTags = function (str) {
if (str === null && str === undefined) return '';
return String(str).replace(/<\/?[^>]+>/ig, '');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment