Edu
Hub
Courses
AI Tools
Leaderboard
Login/Register
AR
Abdullah Rashid
abdullah@example.com
Navigation
📚
Courses
🏆
Leaderboard
✨
AI Tools
←
jQuery Traversing Mastery
⏱
15:00
Quit
0 / 20 answered
0%
jQuery Traversing Mastery
10 questions · Medium difficulty · 00:20:00 min
🔥 In Progress
Question 1
Which jQuery method is used to get the direct parent of each element in the current set of matched elements?
parents()
parent()
closest()
parentUntil()
Question 2
What does the `.children()` method return?
Only direct child elements
All sibling elements
All descendant elements
The parent element
Question 3
Which method would you use to get the next sibling of each element in the set?
prev()
next()
siblings()
nextAll()
Question 4
What is the difference between `.parent()` and `.parents()`?
They are identical
.parent() returns a list, .parents() returns a single element
.parent() returns direct parent, .parents() returns all ancestors
.parent() returns all ancestors, .parents() returns only direct parent
Question 5
Which method is used to traverse down the DOM tree to find elements matching a selector?
filter()
children()
find()
each()
Question 6
What does the `.siblings()` method return?
Only the next sibling
The parent element
All child elements
All elements at the same level as the current element
Question 7
How can you get the first ancestor of an element that matches a given selector?
parent()
find()
closest()
parents()
Question 8
Which method would you use to iterate over a jQuery object and execute a function for each element?
filter()
each()
loop()
map()
Question 9
What does `.prev()` return?
The previous parent element
The previous ancestor element
All previous siblings
The previous sibling element
Question 10
How can you filter the current set of elements to those that match a specific selector?
find()
not()
filter()
children()
Question 11
Which method returns all ancestor elements between the current element and a given selector?
parents()
closest()
parent()
parentsUntil()
Question 12
What does `.nextAll()` return?
Only the next sibling
All following siblings
All preceding siblings
All children
Question 13
Which method is used to get the first element in the set that matches a selector, traversing up the DOM tree?
prev()
parent()
find()
closest()
Question 14
How can you select all elements that are direct children of a div with class 'container'?
$('.container').children()
$('.container').parent()
$('.container > *')
$('.container').find('*')
Question 15
What does `.end()` do in jQuery?
Ends the current jQuery chain and returns to the previous set
Stops event propagation
Removes all elements from the set
Ends the script execution
Question 16
Which method would you use to get the previous siblings until a certain selector is found?
prevAll()
prevUntil()
prev()
parentsUntil()
Question 17
How do you select the immediate parent of an element with id 'child'?
$('#child').prev()
$('#child').closest()
$('#child').parent()
$('#child').parents()
Question 18
What is the result of `$('ul').children('li.active')`?
All active li elements anywhere
All li elements inside ul that have class 'active'
All li elements inside ul
The ul that contains an li with class 'active'
Question 19
Which method allows you to add elements to the current set of matched elements?
append()
add()
concat()
merge()
Question 20
What does `.first()` do?
Returns the first child of each element
Returns the first ancestor
Returns the first sibling
Returns the first element in the current set
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →