Well done!
You have completed Navigating and Manipulating the DOM Tree: Essential Methods and Techniques Quiz!
Quiz Question 1 of 5
Which situation would justify using getElementsByClassName()
instead of querySelectorAll()
when selecting elements from the DOM?
Choose the correct answer below:
-
A
When you need to select multiple elements based on a complex selector combining
ID
,class
, and tag name. -
B
When you need to retrieve elements quickly that share a simple class name.
-
C
When you need to locate elements that are not directly identified by a class name.
-
D
When you need to select the first element that matches a specific query.