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 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 built-in method combines the text of two strings and returns a new string?

A - append()

B - concat()

C - attach()

D - None of the above.

Answer : B

Explaination

concat() method returns the character at the specified index.

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 removes an attribute from each of the matched elements?

A - deleteAttr( name )

B - removeAttr( name )

C - removeAttribute( name )

D - None of the above.

Answer : B

Explaination

The removeAttr( name ) method can be used to remove an attribute from each of the matched elements.

Q 5 - Which of the following jQuery method adds more elements, matched by the given selector, to the set of matched elements?

A - add( selector )

B - addElement( selector )

C - append(selector)

D - None of the above.

Answer : A

Explaination

The add( selector ) method adds more elements, matched by the given selector, to the set of matched elements.

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 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 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 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 can be used to attach a function to be executed when all AJAX requests have ended?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxStop(callback)

Answer : D

Explaination

The ajaxStop( callback ) method can be used to attach a function to be executed when all AJAX requests have ended.

jquery_questions_answers.htm
Advertisements