Skip to content

Instantly share code, notes, and snippets.

@danielnaranjo
Created February 5, 2018 13:28
Show Gist options
  • Save danielnaranjo/53b1a5116599920172f361ec4b33c374 to your computer and use it in GitHub Desktop.
Save danielnaranjo/53b1a5116599920172f361ec4b33c374 to your computer and use it in GitHub Desktop.
// Remove HTML tags from data response
// Example: <p>Hello <strong>World</strong>!</p>
// Return: Hello World!
var cleanTags = function(input) {
return input.replace(/<.+?>/g, '');
}
cleanTags('<p>Hello <strong>World</strong>!</p>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment