1. Home
  2. Computer Science MCQs
  3. Jquery
  4. Which selector in jQuery targets all elements with the…

Added 30 Jan 2024

Which selector in jQuery targets all elements with the specified element name?

  1. .elementName
  2. elementName Correct answer
  3. *
  4. #elementName

Correct answer

B. elementName

15 views

MCQSEXAM

Explanation

The element selector is written simply as the element name: $("p") selects every <p> on the page.

A leading dot selects by class, a hash selects by ID, and * selects all elements. jQuery selectors follow the same rules as CSS selectors.

Want more practice? Try the full set of Computer Science MCQs on MCQsExam.com.

Reference

https://www.w3schools.com/jquery/default.asp

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Jquery MCQs

Practise all Jquery MCQs

Similar MCQs