What is the difference between eq() and get() methods in jQuery?
Answer Posted / chaitanya
eq() returns the element as a jQuery object. This method constructs a new jQuery object from one element within that set and returns it. That means that you can use jQuery functions on it.
get() return a DOM element. The method retrieve the DOM elements matched by the jQuery object. But as it is a DOM element and it is not a jQuery-wrapped object. So jQuery functions can't be used. Find out more here.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to execute jQuery code after the DOM is ready?
What are the types of selectors that are used in jquery? Give examples.
How to Use the jQuery load() Method?
How to always reference latest version of jquery?
Explain event.preventdefault? : jquery mobile
Explain type paremeter of jquery ajax method?
Where jQuery code is getting executed?
Which program is useful for testing jQuery?
How to use jquery library in our asp.net project?
List the advantage of using minimized version of jquery?
How can images be made to appear scrolling one over another?
What is the use of css() method in jquery?
Explain the basic need to start with jquery? : jquery mobile
How to use it jquery knockout?
Give a brief idea about jquery mobile? : jQuery Mobile