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 - Can you assign a anonymous function to a variable?

A - true

B - false

Answer : A

Explaination

Yes! An anonymous function can be assigned to a variable.

Q 2 - Which built-in method removes the last element from an array and returns that element?

A - last()

B - get()

C - pop()

D - None of the above.

Answer : C

Explaination

pop() method removes the last element from an array and returns that element.

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 gets attributes of an element?

A - attr()

B - getAttr()

C - getAttributes()

D - None of the above.

Answer : A

Explaination

The attr() method can be used to fetch the value of an attribute from the first element in the matched set.

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 gets a set of elements containing the unique next siblings of each of the given set of elements?

A - locateNext( selector )

B - getNext( selector)

C - next( selector )

D - None of the above.

Answer : C

Explaination

The next( [selector] ) gets a set of elements containing the unique next siblings of each of the given set of elements.

Q 7 - Which of the following jQuery method sets the style property of an element?

A - setClass( name, value )

B - setStyle( name, value)

C - css( name, value )

D - None of the above.

Answer : C

Explaination

The css( name, value ) method sets a style property on the first 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 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 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