Using the DOM like a Pro - ITNEXT
The legacy of jQuery is quite impressive and a great example of how it influenced the standards are the querySelector and querySelectorAll methods which mimic jQuery’s $ function.
You can use document.querySelectorAll in the same way as document.querySelector. Any valid CSS selector will do and the only difference is querySelector will return a single element whereas querySelectorAll will return a static NodeList containing the found elements. If there are no elements found it will return an empty NodeList.
You don’t necessarily need to run querySelector(All) on document. You can run it on any HTMLElement to run a relative search:
September 3, 2019 at 9:14:25 AM EDT
*
FILLER