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 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 returns the characters in a string beginning at the specified location?

A - substr()

B - getSubstring()

C - slice()

D - None of the above.

Answer : A

Explaination

substr() method returns the characters in a string beginning at the specified location through the specified number of characters.

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 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 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 gets the style property of an element?

A - getClass( name )

B - getStyle( name)

C - css( name )

D - None of the above.

Answer : C

Explaination

The css( name ) method returns a style property on the first matched element.

Q 8 - Which of the following jQuery method returns the outer width (including the border) of an element?

A - getCSSWidth( )

B - getWidth( )

C - outerWidth( [margin] )

D - None of the above.

Answer : C

Explaination

The outerWidth( [margin] ) method gets the outer width (includes the border and padding by default) for 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