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

A - Using args.length property

B - Using arguments.length property

C - Both of the above.

D - None of the above.

Answer : B

Explaination

Using arguments.length property, we can get the total number 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 of the following jQuery selector selects all elements available in a DOM?

A - $('*')

B - $('?')

C - $('#')

D - None of the above.

Answer : A

Explaination

$('*') selects all elements available in a DOM.

Q 4 - Which of the following jQuery method gets attributes of an element?

A - attr()

B - getAttr()

C - getAttributes()

D - None of the above.

Answer : A

Explaination

The attr() method can be used to fetch the value of an attribute from the first element in the matched set.

Q 5 - Which of the following jQuery method selects a subset of the matched elements?

A - subset( selector )

B - getSubset( selector )

C - slice(selector)

D - None of the above.

Answer : C

Explaination

The slice(selector) method selects a subset of the matched elements.

Q 6 - Which of the following jQuery method gets a set of elements containing all of the unique immediate children of each of the matched set of elements?

A - getChild( selector )

B - children( [selector])

C - getChildren(selector)

D - None of the above.

Answer : B

Explaination

The children( [selector]) method gets a set of elements containing all of the unique immediate children of each of the matched set of elements.

Q 7 - Which of the following jQuery method gets the inner height (excluding the border) of an element?

A - getCSSHeight( )

B - innerHeight( )

C - getInnerHeight( )

D - None of the above.

Answer : B

Explaination

The innerHeight( ) method gets the inner height (excludes the border and includes the padding) for the first matched element.

Q 8 - Which of the following jQuery method gets the current offset of the first matched element, in pixels, relative to the document?

A - offset( )

B - offsetParent( )

C - position( )

D - None of the above.

Answer : A

Explaination

The offset( ) method gets the current offset of the first matched element, in pixels, relative to the document.

Q 9 - Which of the following jQuery method binds a handler to one or more events (like click) for an element?

A - bind( type, [data], fn )

B - load(type, [data], fn )

C - attach(type, [data], fn )

D - None of the above.

Answer : A

Explaination

The bind( type, [data], fn ) function binds a handler to one or more events (like click) for each matched element. Can also bind custom events.

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