Skip to content

Instantly share code, notes, and snippets.

@hansamlin
Created January 6, 2021 06:08
Show Gist options
  • Save hansamlin/6169bfd54a486623df6cfccb0b40946c to your computer and use it in GitHub Desktop.
Save hansamlin/6169bfd54a486623df6cfccb0b40946c to your computer and use it in GitHub Desktop.
Remove html tag via js
function strip(html){
let doc = new DOMParser().parseFromString(html, 'text/html');
return doc.body.textContent || "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment