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 - How can you get the total number of arguments passed to a function?

A - Using args.length property

B - Using arguments.length property

C - Both of the above.

D - None of the above.

Answer : B

Explaination

Using arguments.length property, we can get the total number of arguments passed to a function.

Q 2 - Which built-in method adds one or more elements to the end of an array and returns the new length of the array?

A - last()

B - put()

C - push()

D - None of the above.

Answer : C

Explaination

push() method adds one or more elements to the end of an array and returns the new length of the array.

Q 3 - Which of the following jQuery selector select elements whose css class is some-class?

A - $('some-class')

B - $('#some-class')

C - $('.some-class')

D - None of the above.

Answer : C

Explaination

$('.some-class') selects all elements in the document that have a class of some-class.

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 reduce the set of matched elements to a single element?

A - isEqual( index )

B - eq( index )

C - checkEqual( selector )

D - None of the above.

Answer : B

Explaination

The eq( index ) method reduces the set of matched elements to a single element.

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

A - offsetParent( selector )

B - offset( selector)

C - parent( selector )

D - None of the above.

Answer : A

Explaination

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

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 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 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