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 of the following type of variable takes precedence over other if names are same?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : B

Explaination

A local variable takes precedence over a global variable with the same name.

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 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 finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe?

A - getChildren( selector )

B - getContents( [selector])

C - contents(selector)

D - None of the above.

Answer : C

Explaination

The contents( ) method finds all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.

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 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 binds a function to be executed whenever the DOM is ready to be traversed and manipulated?

A - ready(fn)

B - load(fn)

C - reload(fn)

D - None of the above.

Answer : A

Explaination

The ready(fn) function binds a function to be executed whenever the DOM is ready to be traversed and manipulated.

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