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 can you apply a style on an element using jQuery?
Define width() vs css('width')?
How do you install/use jquery in a project. What is the minimum setup needed to start using jquery.
How to execute jQuery code after the DOM is ready?
What are the different type of selectors in jquery?
Name some of the methods of jquery used to provide effects?
What is $() in jquery library?
How do you install/use jquery in a project.
Define jquery connect?
Can you use multiple document.ready() function on the same page?
Explain animate function in jquery?
Explain url paremeter of jquery ajax method?
How can we apply css in div using jquery?
How method can be called inside code behind using jQuery?
How to write browser specific code using jquery? : jquery mobile