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 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 calls a function for each element in the array?

A - while()

B - loop()

C - forEach()

D - None of the above.

Answer : C

Explaination

forEach() method calls a function for each element in the array.

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 sets the html contents of an element?

A - html( val )

B - setHtml( val )

C - setInnerHtml( val )

D - None of the above.

Answer : A

Explaination

The html( val ) method sets the html contents of every matched element.

Q 5 - Which of the following jQuery method get the input value of an element?

A - getContent()

B - val( )

C - getValue( )

D - None of the above.

Answer : B

Explaination

The val( ) method gets the input value of the first matched element.

Q 6 - Which of the following jQuery method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state?

A - revert( )

B - end( )

C - undo( )

D - None of the above.

Answer : B

Explaination

The end( ) method reverts the most recent 'destructive' operation, changing the set of matched elements to its previous state.

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

A - getCSSHeight( )

B - getHeight( )

C - height( )

D - None of the above.

Answer : C

Explaination

The height( ) method gets the CSS height of every matched element.

Q 8 - Which of the following jQuery method removes set of matched elements?

A - empty( )

B - delete( )

C - remove( expr )

D - None of the above.

Answer : C

Explaination

The remove( expr ) method removes all matched elements from the DOM.

Q 9 - Which of the following jQuery method stops the rest of the event handlers from being executed?

A - preventDefault( )

B - stopImmediatePropagation( )

C - stopPropagation( )

D - None of the above.

Answer : B

Explaination

The stopImmediatePropagation() method of Event object stops the rest of the handlers from being executed.

Q 10 - Which of the following jQuery method serializes a set of input elements into a string of data?

A - jQuery.ajax( options )

B - jQuery.ajaxSetup( options )

C - serialize( )

D - serializeArray( )

Answer : C

Explaination

The serialize() method serializes a set of input elements into a string of data.


jquery_questions_answers.htm

Advertisements