nathnolt / query-selector-all-shadow-root

a simple querySelector / querySelectorAll method / shadow dom traverser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

query-selector-all-shadow-root ( $$$ )

a simple querySelectorAll method for shadow dom

Usage

var matchingElements = $$$('.my-selector')

From a different starting node:

var myElement = $$$('#element')[0]
var buttons = $$$('button', myElement)

Note

The way this script works, is that it will traverse all the elements from the rootNode. This is of course slower than some of the alternative options, but this is simpler to use, and fast enough, for if you are using it sparingly. Basically, you will probably use it sparingly, because if you're using it in your own project, you will probably have access to the elements using the application framework itself.

About

a simple querySelector / querySelectorAll method / shadow dom traverser.

License:MIT License


Languages

Language:JavaScript 100.0%