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 type of variable is visible everywhere in your JavaScript code?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Global Variables: A global variable has global scope which means it is visible everywhere in your JavaScript code.

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 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 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 searches for descendent elements that match the specified selectors?

A - locate( selector )

B - find( selector)

C - search( selector )

D - None of the above.

Answer : B

Explaination

The find( selector ) method searches for descendent elements that match the specified selectors.

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 all child nodes from the set of matched elements?

A - empty( )

B - delete( )

C - remove( expr )

D - None of the above.

Answer : A

Explaination

The empty( ) method removes all child nodes from the set of matched elements.

Answer : B

Explaination

The load( url, [data], [callback] ) method load HTML from a remote file and inject it into the DOM.

Q 10 - Which of the following jQuery method loads a remote page using an HTTP request?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : A

Explaination

The jQuery.ajax( options ) method loads a remote page using an HTTP request.

jquery_questions_answers.htm
Advertisements