Created
October 20, 2021 00:49
-
-
Save mgd020/a741b9996e63013a2b43c1fe0f269d10 to your computer and use it in GitHub Desktop.
turn a string of html into a document fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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