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 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 built-in method returns the calling string value converted to upper case?

A - toUpperCase()

B - toUpper()

C - changeCase(case)

D - None of the above.

Answer : A

Explaination

toUpperCase() method returns the calling string value converted to upper case.

Q 4 - Which of the following jQuery method returns true if the specified class is present on at least one of the set of matched elements?

A - hasCSSClass( class )

B - hasStyleClass( class )

C - hasClass( class )

D - None of the above.

Answer : C

Explaination

The hasClass( class ) method returns true if the specified class is present on at least one of 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 gets the style property of an element?

A - getClass( name )

B - getStyle( name)

C - css( name )

D - None of the above.

Answer : C

Explaination

The css( name ) method returns a style property on the first matched element.

Q 8 - Which of the following jQuery method returns the outer height (including the border) of an element?

A - getCSSHeight( )

B - getHeight( )

C - outerHeight( [margin] )

D - None of the above.

Answer : C

Explaination

The outerHeight( [margin] ) method gets the outer height (includes the border and padding by default) for the first matched element.

Q 9 - Which of the following jQuery method binds a handler to one or more events (like click) for an element?

A - bind( type, [data], fn )

B - load(type, [data], fn )

C - attach(type, [data], fn )

D - None of the above.

Answer : A

Explaination

The bind( type, [data], fn ) function binds a handler to one or more events (like click) for each matched element. Can also bind custom events.

Q 10 - Which of the following jQuery method can be used to attach a function to be executed when all AJAX requests have ended?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : D

Explaination

The ajaxStop( callback ) method can be used to attach a function to be executed when all AJAX requests have ended.

jquery_questions_answers.htm
Advertisements