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 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 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 adds more elements, matched by the given selector, to the set of matched elements?

A - add( selector )

B - addElement( selector )

C - append(selector)

D - None of the above.

Answer : A

Explaination

The add( selector ) method adds more elements, matched by the given selector, to the set of matched elements.

Q 6 - Which of the following jQuery method gets a set of elements containing the unique ancestors of the matched set of elements?

A - offsetParent( selector )

B - offset( selector)

C - parents( selector )

D - None of the above.

Answer : C

Explaination

The parents( [selector] ) method gets a set of elements containing the unique ancestors of the matched set of elements (except for the root element).

Q 7 - Which of the following jQuery method finds all sibling elements in front of the current element?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prevAll( [selector] ) method finds all sibling elements in front of the current element.

Q 8 - Which of the following jQuery method removes set of matched elements?

A - empty( )

B - delete( )

C - remove( expr )

D - None of the above.

Answer : C

Explaination

The remove( expr ) method removes all matched elements from the DOM.

Q 9 - Which of the following jQuery method checks if event.stopImmediatePropagation() was ever called on this event object?

A - isDefaultPrevented( )

B - isPropagationStopped( )

C - isImmediatePropagationStopped( )

D - None of the above.

Answer : C

Explaination

The isImmediatePropagationStopped() method of Event object returns whether event.stopImmediatePropagation() was ever called on this event object.

Q 10 - Which of the following jQuery method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : D

Explaination

The serializeArray( ) method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with.

jquery_questions_answers.htm
Advertisements