ShadowRoot
(which extends DocumentFragment
), and Element
both have querySelector
and querySelectorAll
that are scoped properly.
For a custom element, which you use depends on whether you want to query the light or shadow DOM, but since you are using $[]
, you probably want to use the shadow root.
Try this:
List<InputElement> radios = shadowRoot.querySelectorAll("[name='func']");