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 - Which of the following is a valid type of function javascript supports?

A - named function

B - anonymous function

C - Both of the above.

D - None of the above.

Answer : C

Explaination

A function in JavaScript can be either named or anonymous.

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 built-in method sorts the elements of an array?

A - changeOrder(order)

B - order()

C - sort()

D - None of the above.

Answer : C

Explaination

sort() method sorts the elements of an array.

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 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 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 checks if event.stopPropagation() was ever called on this event object?

A - isDefaultPrevented( )

B - isPropagationStopped( )

C - isImmediatePropagationStopped( )

D - None of the above.

Answer : B

Explaination

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

Answer : C

Explaination

The jQuery.getScript( url, [callback] ) method loads and executes a JavaScript file using an HTTP GET request.

jquery_questions_answers.htm
Advertisements