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 - Which of the following is a valid type of function javascript supports?

A - named function

B - anonymous function

C - Both of the above.

D - None of the above.

Answer : C

Explaination

A function in JavaScript can be either named or anonymous.

Q 2 - Which built-in method returns the character at the specified index?

A - characterAt()

B - getCharAt()

C - charAt()

D - None of the above.

Answer : C

Explaination

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

Q 3 - Which of the following jQuery selector selects elements with the given element tag-name?

A - $('tag-name')

B - $('#tag-name')

C - $('.tag-name')

D - None of the above.

Answer : A

Explaination

$('tag-name') selects all element of type tag-name in the document. For example, $('p') selects all paragraphs <p> in the document.

Q 4 - Which of the following jQuery method returns true if the specified class is present on at least one of the set of matched elements?

A - hasCSSClass( class )

B - hasStyleClass( class )

C - hasClass( class )

D - None of the above.

Answer : C

Explaination

The hasClass( class ) method returns true if the specified class is present on at least one of the set of matched elements.

Q 5 - Which of the following jQuery method sets the text of an element?

A - text( val )

B - setText( val )

C - setContent( val )

D - None of the above.

Answer : A

Explaination

The text( val ) sets the text contents of all matched elements.

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

A - offsetParent( selector )

B - offset( selector)

C - parent( selector )

D - None of the above.

Answer : A

Explaination

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

Q 7 - Which of the following jQuery method gets the width property of an element?

A - getCSSWidth( )

B - getWidth( )

C - width( )

D - None of the above.

Answer : C

Explaination

The width( ) method gets the width of every matched element.

Q 8 - Which of the following jQuery method removes all child nodes from the set of matched elements?

A - empty( )

B - delete( )

C - remove( expr )

D - None of the above.

Answer : A

Explaination

The empty( ) method removes all child nodes from the set of matched elements.

Answer : B

Explaination

The load( url, [data], [callback] ) method load HTML from a remote file and inject it into the DOM.

Q 10 - Which of the following jQuery method can be used to attach a function to be executed whenever an AJAX request is sent?

A - ajaxStart( callback )

B - ajaxComplete( callback )

C - ajaxSend( callback )

D - ajaxError(callback)

Answer : C

Explaination

The ajaxSend( callback ) method can be used to attach a function to be executed whenever an AJAX request is sent.


jquery_questions_answers.htm

Advertisements