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

A - using typeof operator

B - using getType function

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Using typeof operator, we can get the type of arguments passed to a function.

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 element with the given element id some-id?

A - $('some-id')

B - $('#some-id')

C - $('.some-id')

D - None of the above.

Answer : B

Explaination

$('#some-id') selects the single element in the document that has an ID of some-id.

Q 4 - Which of the following jQuery method adds the specified class if it is not present, remove the specified class if it is present?

A - toggleStyleClass( class )

B - toggleClass( class )

C - toggleCSSClass( class )

D - None of the above.

Answer : B

Explaination

The toggleClass(class) method adds the specified class if it is not present, removes the specified class if it is present.

Q 5 - Which of the following jQuery method checks the current selection against an expression?

A - getIs( selector )

B - is( selector )

C - checkIs( selector )

D - None of the above.

Answer : B

Explaination

The is( selector ) method checks the current selection against an expression and returns true, if at least one element of the selection fits the given selector.

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 finds all sibling elements in front of the current element?

A - parents( selector )

B - prevAll( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prevAll( [selector] ) method finds all sibling elements in front of the current element.

Q 8 - Which of the following jQuery method gets the current offset of the first matched element, in pixels, relative to the document?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : A

Explaination

The offset( ) method gets the current offset of the first matched element, in pixels, relative to the document.

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

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : B

Explaination

The ajaxComplete( callback ) method can be used to register a callback to be executed whenever an AJAX request completes.

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
Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements