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 returns the length of the string?

A - length()

B - size()

C - index()

D - None of the above.

Answer : A

Explaination

length() method returns the length of the string.

Q 3 - Which of the following jQuery selector selects all elements available in a DOM?

A - $('*')

B - $('?')

C - $('#')

D - None of the above.

Answer : A

Explaination

$('*') selects all elements available in a DOM.

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

A - text( val )

B - setText( val )

C - setContent( val )

D - None of the above.

Answer : A

Explaination

The text( val ) sets the text contents of all 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 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 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 can be used to attach a function to be executed whenever an AJAX request begins and there is none already active?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : A

Explaination

The ajaxStart( callback ) method can be used to attach a function to be executed whenever an AJAX request begins and there is none already active.

Answer : A

Explaination

The jQuery.get( url, [data], [callback], [type] ) method loads a remote page using an HTTP GET request.

jquery_questions_answers.htm
Advertisements