Which of the following methods can select multiple elements?
- querySelector
- getElementByClass
- getElementByTag
- querySelectorAll
The querySelectorAll method can select multiple elements that match a specified CSS selector. It returns a NodeList containing all matching elements. The other options select only single elements.
Loading...
Related Quiz
- In the method myArray.map(callback), what is the second argument passed to the callback?
- Given the short-circuiting nature of logical operators in JavaScript, what will be the output of the expression false && someUndeclaredVariable?
- How can you select an element within a specific parent element using JavaScript?
- What is the main difference between stopPropagation and stopImmediatePropagation?
- What is the primary use of the switch statement in JavaScript?