• jQuery Video Tutorials

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 - 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 calls a function for each element in the array?

A - while()

B - loop()

C - forEach()

D - None of the above.

Answer : C

Explaination

forEach() method calls a function for each element in the array.

Q 3 - Which built-in method sorts the elements of an array?

A - changeOrder(order)

B - order()

C - sort()

D - None of the above.

Answer : C

Explaination

sort() method sorts the elements of an array.

Q 4 - Which of the following jQuery method remove all or the specified class(es) from the set of matched elements?

A - removeClass( class )

B - removeStyleClass( class )

C - removeCSSClass( class )

D - None of the above.

Answer : A

Explaination

The removeClass(class) method remove all or the specified class(es) from the set of matched elements.

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

A - setContent( val )

B - val( val )

C - setValue( val )

D - None of the above.

Answer : B

Explaination

The val(val) method sets the value attribute of every matched element if it is called on <input> but if it is called on <select> with the passed <option> value then passed option would be selected, if it is called on check box or radio box then all the matching check box and radiobox would be checked.

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 height property of an element?

A - setCSSHeight( value )

B - setHeight( value)

C - height( value )

D - None of the above.

Answer : C

Explaination

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

Q 8 - Which of the following jQuery method returns the top and left position of an element relative to its offset parent?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : C

Explaination

The position( ) method gets the top and left position of an element relative to its offset parent.

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

A - ajaxStart( callback )

B - ajaxSuccess( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : B

Explaination

The ajaxSuccess( callback ) method can be used to attach a function to be executed whenever AJAX request completed successfully.

jquery_questions_answers.htm
Advertisements