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 removes the last element from an array and returns that element?

A - last()

B - get()

C - pop()

D - None of the above.

Answer : C

Explaination

pop() method removes the last element from an array and returns that element.

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 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 filter out elements from a set of matched elements?

A - filter( selector )

B - setFilter( selector )

C - putFilter( selector )

D - None of the above.

Answer : A

Explaination

The filter( selector ) method can be used to filter out all elements from the set of matched elements that do not match the specified selector(s). The selector can be written using any selector syntax.

Q 6 - Which of the following jQuery method gets a set of elements containing the unique ancestors of the matched set of elements?

A - offsetParent( selector )

B - offset( selector)

C - parents( selector )

D - None of the above.

Answer : C

Explaination

The parents( [selector] ) method gets a set of elements containing the unique ancestors of the matched set of elements (except for the root element).

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 returns the top and left position of an element relative to its offset parent?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : C

Explaination

The position( ) method gets the top and left position of an element relative to its offset parent.

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.

Answer : B

Explaination

The jQuery.getJSON( url, [data], [callback], [type] ) method loads JSON data using an HTTP GET request.


jquery_questions_answers.htm

Advertisements