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 - How can you get the type of arguments passed to a function?

A - using typeof operator

B - using getType function

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Using typeof operator, we can get the type of arguments passed to a function.

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 selects element with the given element id some-id?

A - $('some-id')

B - $('#some-id')

C - $('.some-id')

D - None of the above.

Answer : B

Explaination

$('#some-id') selects the single element in the document that has an ID of some-id.

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 reduce the set of matched elements to a single element?

A - isEqual( index )

B - eq( index )

C - checkEqual( selector )

D - None of the above.

Answer : B

Explaination

The eq( index ) method reduces the set of matched elements to a single 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 sets the width property of an element?

A - setCSSWidth( value )

B - setWidth( value)

C - width( value )

D - None of the above.

Answer : C

Explaination

The width( value ) method sets the width of every matched element.

Q 8 - Which of the following jQuery method returns a jQuery collection with the positioned parent of the first matched element?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : B

Explaination

The offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.

Q 9 - Which of the following jQuery method stops the bubbling of an event to parent elements?

A - preventDefault( )

B - stopImmediatePropagation( )

C - stopPropagation( )

D - None of the above.

Answer : C

Explaination

The stopPropagation() method of Event object stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.

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