In contrast, querySelectorAll returns a static collection. It’s like a fixed array of elements.… querySelector
CSS-selector
✔
-
querySelectorAll
CSS-selector
✔
-
getElementById
id
-
-
getElementsByName… or '*'
✔
✔
getElementsByClassName
class
✔
✔
By far the most used are querySelector and querySelectorAll
That can be easily checked if we run querySelectorAll: nodes are still at their places.