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 returns the length of the string?

A - length()

B - size()

C - index()

D - None of the above.

Answer : A

Explaination

length() method returns the length of the string.

Q 3 - Which built-in method returns the characters in a string beginning at the specified location?

A - substr()

B - getSubstring()

C - slice()

D - None of the above.

Answer : A

Explaination

substr() method returns the characters in a string beginning at the specified location through the specified number of characters.

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 get the input value of an element?

A - getContent()

B - val( )

C - getValue( )

D - None of the above.

Answer : B

Explaination

The val( ) method gets the input value of the first matched element.

Q 6 - Which of the following jQuery method finds all sibling elements after the current element?

A - locateNextAll( selector )

B - getNextAll( selector)

C - nextAll( selector )

D - None of the above.

Answer : C

Explaination

The nextAll( [selector] ) finds all sibling elements after the current 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 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.

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