Created
September 6, 2017 10:21
-
-
Save freshcutdevelopment/640a0abdd78fa419b694a9f3e0e52c03 to your computer and use it in GitHub Desktop.
Vanilla shadow DOM HTML snippet (Blog)
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
<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