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
Can you please explain the difference between parent() and parents() methods in jquery? : jquery mobile
Explain remove class jquery with example?
How to write browser specific code using jquery? : jquery mobile
What is jquery connect and how to use it?
How we can remove an attribute of an html tag in jquery?
Do we need to add jQuery file in both Master and Content page?
Tell me how to check if number is numeric while using jquery 1.7+? : jquery mobile
What is the difference between prop() and attr() in jquery?
List the advantage of using minimized version of jquery?
How to debug jQuery?
What is jquery.noconflict? Explain
How can events be prevented from stopping to work after an ajax request?
Define the script build up by jquery?
What is ajax and how it works?
Difference between document.ready() and body onload()?