Simplified guide of MCQs for Exams, Interviews

Sub Topic: Jquery

1 .  Which of the following jQuery method gets attributes of an element?

  • A. attr()
  • B. getAttr()
  • C. getAttributes()
  • D. None of the above.

Correct Answer:

attr()


2 .  Which of the following jQuery method removes set of matched elements?

  • A. empty( )
  • B. delete( )
  • C. remove( expr )

Correct Answer:

remove( expr )


3 .  Which of the following jQuery method stops the rest of the event handlers from being executed?

  • A. preventDefault( )
  • B. stopImmediatePropagation( )
  • C. stopPropagation( )

Correct Answer:

stopImmediatePropagation( )


4 .  Which built-in method returns the length of the string?

  • A. length()
  • B. size()
  • C. index()

Correct Answer:

length()


5 .  Which of the following jQuery method set the value of an element?

  • A. setContent( val )
  • B. val( val )
  • C. setValue( val )

Correct Answer:

val( val )