What does the jQuery selector $('.item') select?
-
A
All elements with class 'item'
Correct answer
-
B
Only the first 'item' element
-
C
The element with id 'item'
-
D
All <item> tag elements
Correct answer
A. All elements with class 'item'
13 views
Explanation
jQuery selectors follow CSS syntax: .item selects by class, #item by id, and item by tag name.
Reference
Asked in: Frontend Developer Tests, Technical Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ