Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Vanilla shadow DOM HTML snippet (Blog)
<html>
<head></head>
<body>
<p id="component-host"></p>
<script>
var shadowElement = document.querySelector('#component-host')
.attachShadow({mode: 'open'});
shadow.innerHTML = '<span>DOM subtree</span>';
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment