- Select an Element by ID 6:21
- Select by ID 2 objectives
- Select Elements by Tag Name 7:40
- Select by Tag Name 1 objective
- Select Elements by Class Name 3:48
- Selection Review 5 questions
- Use CSS Queries to Select Page Elements 6:10
- Getting a Handle on the DOM Review 5 questions
- Return Elements Using CSS Selectors 3 objectives
Well done!
You have completed Getting a Handle on the DOM Review!
Quiz Question 1 of 5
What is one difference between the methods querySelector()
and querySelectorAll()
?
Choose the correct answer below:
-
A
There is effectively no difference between both methods.
-
B
querySelector()
returns the first element it matches, whilequerySelectorAll()
returns all matching elements. -
C
querySelector()
returns all matching elements, whilequerySelectorAll()
returns only the first matching element. -
D
querySelector()
returns an HTMLCollection, whilequerySelectorAll()
returns a NodeList.