12. <template>
<style> p { color: red; } </style>
<p>I am Shadow DOM!</p>
</template>
<script>
var proto = Object.create(HTMLElement.prototype, {
createdCallback: function(){
var t = document.querySelector(“template”);
var clone = document.importNode(t.content, true);
this.createShadowRoot().appendChild(clone);
}
});
document.registerElement(“sample-template”, {
prototype: proto
});
</script>