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 only within a function where it is defined?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : B

Explaination

Local Variables: A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.

Q 2 - Which built-in method returns the character at the specified index?

A - characterAt()

B - getCharAt()

C - charAt()

D - None of the above.

Answer : C

Explaination

charAt() 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 apply a style on an element?

A - addStyle(classes)

B - addClass( classes )

C - addCSSClass(classes)

D - None of the above.

Answer : B

Explaination

The addClass( classes ) method can be used to apply defined style sheets onto all the matched elements. You can specify multiple classes separated by space.

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

A - getCSSHeight( )

B - getHeight( )

C - height( )

D - None of the above.

Answer : C

Explaination

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

Q 8 - Which of the following jQuery method gets the inner width (excluding the border) of an element?

A - getCSSWidth( )

B - innerWidth( )

C - getInnerWidth( )

D - None of the above.

Answer : B

Explaination

The innerWidth( ) method gets the inner width (excludes the border and includes the padding) for 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 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.

Q 10 - Which of the following jQuery method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : D

Explaination

The serializeArray( ) method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with.


jquery_questions_answers.htm

Advertisements
E-Books Store