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 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 built-in method returns the string representation of the number's value?

A - toValue()

B - toNumber()

C - toString()

D - None of the above.

Answer : C

Explaination

toString() method returns the string representation of the number's value.

Q 4 - Which of the following jQuery method removes an attribute from each of the matched elements?

A - deleteAttr( name )

B - removeAttr( name )

C - removeAttribute( name )

D - None of the above.

Answer : B

Explaination

The removeAttr( name ) method can be used to remove an attribute from each of the matched elements.

Q 5 - Which of the following jQuery method adds the previous selection to the current selection?

A - add( selector )

B - andSelf( )

C - append(selector)

D - None of the above.

Answer : B

Explaination

The andSelf( ) method adds the previous selection to the current selection.

Q 6 - Which of the following jQuery method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe?

A - getChildren( selector )

B - getContents( [selector])

C - contents(selector)

D - None of the above.

Answer : C

Explaination

The contents( ) method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.

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

A - setCSSWidth( value )

B - setWidth( value)

C - width( value )

D - None of the above.

Answer : C

Explaination

The width( value ) method sets the width of every matched element.

Q 8 - Which of the following jQuery method gets the current offset of the first matched element, in pixels, relative to the document?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : A

Explaination

The offset( ) method gets the current offset of the first matched element, in pixels, relative to the document.

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.

Answer : B

Explaination

The jQuery.getJSON( url, [data], [callback], [type] ) method loads JSON data using an HTTP GET request.


jquery_questions_answers.htm

Advertisements