• jQuery Video Tutorials

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 2 - Which built-in method returns the index within the calling String object of the first occurrence of the specified value?

A - getIndex()

B - location()

C - indexOf()

D - None of the above.

Answer : C

Explaination

indexOf() method returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.

Q 3 - Which of the following jQuery selector selects elements with the given element tag-name?

A - $('tag-name')

B - $('#tag-name')

C - $('.tag-name')

D - None of the above.

Answer : A

Explaination

$('tag-name') selects all element of type tag-name in the document. For example, $('p') selects all paragraphs <p> in the document.

Q 4 - Which of the following jQuery method gets the html contents (innerHTML) of the first matched element?

A - html( )

B - getHtml( )

C - getInnerHtml( )

D - None of the above.

Answer : A

Explaination

The html() method gets the html contents (innerHTML) of the first matched element.

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 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 a set of elements containing the unique previous siblings of each of the matched set of elements?

A - parents( selector )

B - prev( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prev( [selector] ) method gets a set of elements containing the unique previous siblings of each of the matched set of elements.

Q 8 - Which of the following jQuery method checks if event.preventDefault() was ever called on this event object?

A - isDefaultPrevented( )

B - isPropagationStopped( )

C - isImmediatePropagationStopped( )

D - None of the above.

Answer : A

Explaination

The isDefaultPrevented() method of Event object returns whether event.preventDefault() was ever called on this event object.

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