Created
February 9, 2018 06:15
-
-
Save Axure/d5ef6239da1f159064983a5d53b947b1 to your computer and use it in GitHub Desktop.
host in DOM
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
<button class="red">My Button</button> | |
<script> | |
var button = document.querySelector('button'); | |
var root = button.createShadowRoot(); | |
root.innerHTML = '<style>' + | |
':host { text-transform: uppercase; }' + | |
'</style>' + | |
'<content></content>'; | |
console.log(root.host); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment