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 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 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 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 removes elements matching the specified selector from the set of matched elements?

A - getNotEquals( selector )

B - isNotEquals( selector )

C - not(selector)

D - None of the above.

Answer : C

Explaination

The not(selector) method removes elements matching the specified selector from the set of matched elements.

Q 6 - Which of the following jQuery method finds all sibling elements after the current element?

A - locateNextAll( selector )

B - getNextAll( selector)

C - nextAll( selector )

D - None of the above.

Answer : C

Explaination

The nextAll( [selector] ) finds all sibling elements after the current element.

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

A - setCSSHeight( value )

B - setHeight( value)

C - height( value )

D - None of the above.

Answer : C

Explaination

The height( value ) method sets the CSS height of every matched 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 stops the bubbling of an event to parent elements?

A - preventDefault( )

B - stopImmediatePropagation( )

C - stopPropagation( )

D - None of the above.

Answer : C

Explaination

The stopPropagation() method of Event object stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.

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