Q
What does document.querySelectorAll('.temp') return?
-
A
A live HTMLCollection
-
B
A static NodeList of all the matching elements
-
C
An array of strings
-
D
Only the first matching element
Correct Answer:
B. A static NodeList of all the matching elements
Explanation:
querySelector returns only the first match. getElementsByClassName returns a live collection.