jQuery - Online Quiz



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 2 - Which built-in method reverses the order of the elements of an array?

A - changeOrder(order)

B - reverse()

C - sort(order)

D - None of the above.

Answer : B

Explaination

reverse() method reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.

Q 3 - Which of the following jQuery selector selects all elements available in a DOM?

A - $('*')

B - $('?')

C - $('#')

D - None of the above.

Answer : A

Explaination

$('*') selects all elements available in a DOM.

Q 4 - Which of the following jQuery method get the text contents of an element?

A - text( )

B - getText( )

C - getContent( )

D - None of the above.

Answer : A

Explaination

The text( ) method gets the combined text contents of all matched elements.

Q 5 - Which of the following jQuery method get the input value of an element?

A - getContent()

B - val( )

C - getValue( )

D - None of the above.

Answer : B

Explaination

The val( ) method gets the input value of the first matched element.

Q 6 - Which of the following jQuery method gets the direct parent of an element?

A - offsetParent( selector )

B - offset( selector)

C - parent( selector )

D - None of the above.

Answer : C

Explaination

The parent( [selector] ) method gets the direct parent of an element. If called on a set of elements, parent returns a set of their unique direct parent elements.

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 prevents the browser from executing the default action?

A - preventDefault( )

B - stopImmediatePropagation( )

C - stopPropagation( )

D - None of the above.

Answer : A

Explaination

The preventDefault() method of Event object prevents the browser from executing the default action.

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 loads a remote page using an HTTP request?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : A

Explaination

The jQuery.ajax( options ) method loads a remote page using an HTTP request.

jquery_questions_answers.htm
Advertisements