Well done!
You have completed Navigating and Manipulating the DOM Tree: Essential Methods and Techniques Quiz!
Quiz Question 1 of 5
Consider you want to select multiple elements that share a common CSS class and belong to a specific parent element. Which method would be the most effective?
Choose the correct answer below:
-
A
Use
querySelectorAll()
with a complex selector that combines the parent and class criteria. -
B
Use
getElementsByClassName()
directly on the document object to get all elements. -
C
Use
getElementById()
to locate the parent element first, then callgetElementsByClassName()
on that element. -
D
Use
getElementsByTagName()
on the parent element and filter the results manually by class.