• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Using the DOM like a Pro - ITNEXT

QRCode

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:

https://itnext.io/using-the-dom-like-a-pro-163a6c552eba
September 3, 2019 at 9:14:25 AM EDT *
javascript jquery
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community