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 - Which of the following is a valid type of function javascript supports?

A - named function

B - anonymous function

C - Both of the above.

D - None of the above.

Answer : C

Explaination

A function in JavaScript can be either named or anonymous.

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 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 sets attributes of an element?

A - attr(name, value)

B - setAttr(name, value)

C - setAttributes(name, value)

D - None of the above.

Answer : A

Explaination

The attr(name, value) method can be used to set the named attribute onto all elements in the wrapped set using the passed value.

Q 5 - Which of the following jQuery method checks the current selection against an expression?

A - getIs( selector )

B - is( selector )

C - checkIs( selector )

D - None of the above.

Answer : B

Explaination

The is( selector ) method checks the current selection against an expression and returns true, if at least one element of the selection fits the given selector.

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 a set of elements containing all of the unique siblings of each of the matched set of elements?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : C

Explaination

The siblings( [selector] ) method gets a set of elements containing all of the unique siblings of each of the matched set of elements.

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 can be used to attach a function to be executed whenever an AJAX request completes?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : B

Explaination

The ajaxComplete( callback ) method can be used to register a callback to be executed whenever an AJAX request completes.

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