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 1 - How can you get the type of arguments passed to a function?

A - using typeof operator

B - using getType function

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Using typeof operator, we can get the type of arguments passed to a function.

Q 2 - Which built-in method combines the text of two strings and returns a new string?

A - append()

B - concat()

C - attach()

D - None of the above.

Answer : B

Explaination

concat() method returns the character at the specified index.

Q 3 - Which of the following jQuery selector selects elements with the given element tag-name?

A - $('tag-name')

B - $('#tag-name')

C - $('.tag-name')

D - None of the above.

Answer : A

Explaination

$('tag-name') selects all element of type tag-name in the document. For example, $('p') selects all paragraphs <p> in the document.

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 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 reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state?

A - revert( )

B - end( )

C - undo( )

D - None of the above.

Answer : B

Explaination

The end( ) method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state.

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

A - getCSSHeight( )

B - getHeight( )

C - height( )

D - None of the above.

Answer : C

Explaination

The height( ) method gets the CSS height of every matched element.

Q 8 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : B

Explaination

The offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.

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

A - isDefaultPrevented( )

B - isPropagationStopped( )

C - isImmediatePropagationStopped( )

D - None of the above.

Answer : B

Explaination

The isPropagationStopped() method of Event object returns whether event.stopPropagation() 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