Created
September 6, 2017 10:21
Star
You must be signed in to star a gist
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