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 - Can you assign a anonymous function to a variable?

A - true

B - false

Answer : A

Explaination

Yes! An anonymous function can be assigned to a variable.

Q 2 - Which built-in method adds one or more elements to the end of an array and returns the new length of the array?

A - last()

B - put()

C - push()

D - None of the above.

Answer : C

Explaination

push() method adds one or more elements to the end of an array and returns the new length of the 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 removes elements matching the specified selector from the set of matched elements?

A - getNotEquals( selector )

B - isNotEquals( selector )

C - not(selector)

D - None of the above.

Answer : C

Explaination

The not(selector) method removes elements matching the specified selector from the set of 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 a set of elements containing the unique previous siblings of each of the matched set of elements?

A - parents( selector )

B - prev( selector)

C - siblings( selector )

D - None of the above.

Answer : B

Explaination

The prev( [selector] ) method gets a set of elements containing the unique previous siblings of each of the matched set of elements.

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

A - getCSSWidth( )

B - innerWidth( )

C - getInnerWidth( )

D - None of the above.

Answer : B

Explaination

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

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