1. Home
  2. Computer Science MCQs
  3. Jquery
  4. Which method in jQuery is used to set the CSS properties…

Added 30 Jan 2024

Which method in jQuery is used to set the CSS properties of elements?

  1. style()
  2. setStyle()
  3. css() Correct answer
  4. applyStyle()

Correct answer

C. css()

16 views

MCQSEXAM

Explanation

css() gets or sets style properties: $("p").css("color", "red") sets one property, and passing an object sets several at once.

For anything beyond small changes, addClass() and removeClass() are cleaner. style(), setStyle() and applyStyle() do not exist in jQuery.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is C? 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