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 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 built-in method returns the characters in a string beginning at the specified location?

A - substr()

B - getSubstring()

C - slice()

D - None of the above.

Answer : A

Explaination

substr() method returns the characters in a string beginning at the specified location through the specified number of characters.

Q 4 - Which of the following jQuery method get the text contents of an element?

A - text( )

B - getText( )

C - getContent( )

D - None of the above.

Answer : A

Explaination

The text( ) method gets the combined text contents of all matched elements.

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

A - getContent()

B - val( )

C - getValue( )

D - None of the above.

Answer : B

Explaination

The val( ) method gets the input value of the first matched element.

Q 6 - Which of the following jQuery method gets a set of elements containing all of the unique immediate children of each of the matched set of elements?

A - getChild( selector )

B - children( [selector])

C - getChildren(selector)

D - None of the above.

Answer : B

Explaination

The children( [selector]) method gets a set of elements containing all of the unique immediate children of each of the matched set of elements.

Q 7 - Which of the following jQuery method gets a set of elements containing all of the unique siblings of each of the matched set of elements?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : C

Explaination

The siblings( [selector] ) method gets a set of elements containing all of the unique siblings of each of the matched set of elements.

Q 8 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : B

Explaination

The offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.

Q 9 - Which of the following jQuery method can be used to attach a function to be executed whenever an AJAX request fails?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxError(callback)

Answer : D

Explaination

The ajaxError( callback ) method can be used to attach a function to be executed whenever an AJAX request fails.

Q 10 - Which of the following jQuery method can be used to attach a function to be executed whenever an AJAX request is sent?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxError(callback)

Answer : C

Explaination

The ajaxSend( callback ) method can be used to attach a function to be executed whenever an AJAX request is sent.


jquery_questions_answers.htm

Advertisements