Web component API example: adding a native template to the DOM
A Pen by Mike North on CodePen.
Web component API example: adding a native template to the DOM
A Pen by Mike North on CodePen.
<template id="something"> | |
<h1>Hello, world!</h1> | |
</template> |
var tmpl = document.querySelector('#something'); | |
var tmplClone = document.importNode(tmpl.content, true); | |
document.body.appendChild(tmplClone); |