jQuery - Online Quiz


Advertisements

Following quiz provides Multiple Choice Questions (MCQs) related to jQuery Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Can you pass a anonymous function as an argument to another function?

A - true

B - false

Answer : A

Explaination

Yes! An anonymous function can be passed as an argument to another function.

Q 2 - Which built-in method adds one or more elements to the end of an array and returns the new length of the array?

A - last()

B - put()

C - push()

D - None of the above.

Answer : C

Explaination

push() method adds one or more elements to the end of an array and returns the new length of the array.

Q 4 - Which of the following jQuery method apply a style on an element?

A - addStyle(classes)

B - addClass( classes )

C - addCSSClass(classes)

D - None of the above.

Answer : B

Explaination

The addClass( classes ) method can be used to apply defined style sheets onto all the matched elements. You can specify multiple classes separated by space.

Q 5 - Which of the following jQuery method sets the text of an element?

A - text( val )

B - setText( val )

C - setContent( val )

D - None of the above.

Answer : A

Explaination

The text( val ) sets the text contents of all matched elements.

Q 6 - Which of the following jQuery method finds all sibling elements after the current element?

A - locateNextAll( selector )

B - getNextAll( selector)

C - nextAll( selector )

D - None of the above.

Answer : C

Explaination

The nextAll( [selector] ) finds all sibling elements after the current element.

Q 7 - Which of the following jQuery method gets the width property of an element?

A - getCSSWidth( )

B - getWidth( )

C - width( )

D - None of the above.

Answer : C

Explaination

The width( ) method gets the width of every matched element.

Q 8 - Which of the following jQuery method removes all child nodes from the set of matched elements?

A - empty( )

B - delete( )

C - remove( expr )

D - None of the above.

Answer : A

Explaination

The empty( ) method removes all child nodes from the set of matched elements.

Q 9 - Which of the following jQuery method can be used to attach a function to be executed whenever an AJAX request fails?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxError(callback)

Answer : D

Explaination

The ajaxError( callback ) method can be used to attach a function to be executed whenever an AJAX request fails.

Q 10 - Which of the following jQuery method setups global settings for AJAX requests?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : B

Explaination

The jQuery.ajaxSetup( options ) method setups global settings for AJAX requests.

jquery_questions_answers.htm
Advertisements