I have a structure:
<div>
#shadow-root
<span>
How do I reference the div
from the span
?
span.parentNode
is the #shadow-root
, and .parentNode
from that is null
You can use shadowRoot.host
to give you the <div>
. Likewise, div.shadowRoot
would get you the div's shadow root.