Open In App

Web technologies Questions | jQuery Quiz | Set-3 | Question 3

Like Article
Like
Save
Share
Report

What is the correct occurrence of the following code:

$('#functioncode').find('list') .width(300).addClass('selectedList')

(A) AJAX
(B) Animating
(C) Chaining
(D) Event bubbling


Answer: (C)

Explanation: While using method chaining in jQuery, it ensures that there is no need to use the same selector more than once. Over-using a selector can seriously slow down your code, as every time you call on a selector you are forcing the browser to go looking for it. By combining or “chaining” multiple methods, you can seriously cut down on the number of times you make your browser look for the same elements without having to set any variables.

Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 20 Sep, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads