Accessing elements in the shadow DOM
There’s no way to access the shadow root of native HTML 5 elements. Not useful in this case, but with Chrome it’s possible to access a custom created shadow root: var root = document.querySelector(“#test_button”).createShadowRoot(); root.innerHTML = “<button id=’inner_button’>Button in button</button” <button id=”test_button”></button> The root can then be accessed this way: var element = document.querySelector(“#test_button”).shadowRoot; If … Read more