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
What does dollar sign ($) means in jquery? : jquery mobile
What is .siblings() method in jquery?
Differentiate between calling stop (true, true) and finish method?
What are the browser related issues for jQuery?
Can you give me a brief history of your programming days? Where did it all start?
How can related code be encapsulated? Give example.
Explain the types of selectors in jquery?
What are selectors in jquery? : jQuery Mobile
How to get the current offset of the first matched element, in pixels, relative to the document using ?
In what scenarios jQuery can be used?
What is the difference between find and children methods?
What are the slow selectors in jquery? : jquery mobile
What is parseint() and why it is used?
Tell me what is the use of .size() method in jquery?
What is method chaining in jquery?