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.

Answer : C

Explaination

A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered.

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 checks the current selection against an expression?

A - getIs( selector )

B - is( selector )

C - checkIs( selector )

D - None of the above.

Answer : B

Explaination

The is( selector ) method checks the current selection against an expression and returns true, if at least one element of the selection fits the given selector.

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 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 prevents the browser from executing the default action?

A - preventDefault( )

B - stopImmediatePropagation( )

C - stopPropagation( )

D - None of the above.

Answer : A

Explaination

The preventDefault() method of Event object prevents the browser from executing the default action.

Answer : B

Explaination

The load( url, [data], [callback] ) method load HTML from a remote file and inject it into the DOM.

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