Created
September 8, 2019 09:49
-
-
Save thanapongp/a9a248d2ea23ff9050021f31092bdfd0 to your computer and use it in GitHub Desktop.
util.js with updated htmlToElement
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
export function htmlToElement(html) { | |
const template = document.createElement('template'); | |
template.innerHTML = html.trim(); | |
return template.content.firstElementChild; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment