Skip to content

Instantly share code, notes, and snippets.

@mgd020
Created October 20, 2021 00:49
Show Gist options
  • Save mgd020/a741b9996e63013a2b43c1fe0f269d10 to your computer and use it in GitHub Desktop.
Save mgd020/a741b9996e63013a2b43c1fe0f269d10 to your computer and use it in GitHub Desktop.
turn a string of html into a document fragment
function parseHTML(html) {
var template = document.createElement('template');
template.innerHTML = html;
return template.content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment