Skip to content

Instantly share code, notes, and snippets.

@dustinpoissant
Created April 22, 2020 18:55
Show Gist options
  • Save dustinpoissant/d010e8cc239aca0cab60fc6826d4406d to your computer and use it in GitHub Desktop.
Save dustinpoissant/d010e8cc239aca0cab60fc6826d4406d to your computer and use it in GitHub Desktop.
stringToDom
const stringToDOM = str => new DOMParser().parseFromString(str, 'text/html').body.childNodes[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment