How do you select all elements with a specific class in jQuery?
Correct answer
B. $(".classname")
16 views
B. $(".classname")
16 views
$(".classname") selects all elements with that class: the dot marks a class selector and $() is the jQuery function that runs it.
# would select by ID, and .classname{} is CSS rule syntax, not a jQuery call.
For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.
Not sure why the answer is B? Ask here and get an explanation.