<template id="content">

<div id="shadow-dom-host"></div>

View Compiled
// Polyfill support
HTMLElement.prototype.createShadowRoot = 
  HTMLElement.prototype.createShadowRoot ||
  HTMLElement.prototype.webkitCreateShadowRoot ||
  function() {};

var tmpl = document.querySelector('#content');
var host = document.querySelector('#shadow-dom-host');
// Create a Shadow Root
var root = host.createShadowRoot();
// Append elements to the Shadow Root
root.appendChild(document.importNode(tmpl.content, true));

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.