What is the difference between eq() and get() methods in jQuery?



What is the difference between eq() and get() methods in jQuery?..

Answer / 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

More jQuery Interview Questions

How to redirect to another page using jquery?

0 Answers  


What are the paremeter of jquery ajax method?

0 Answers  


Explain the difference between .empty() and .remove() ?

0 Answers  


Is it possible to use jquery to make ajax request? : jquery mobile

0 Answers  


Hide and show image on button click using jQuery?

0 Answers  


Which is the fastest selector in jQuery?

0 Answers  


What is event.PreventDefault in jQuery?

0 Answers  


Explain the use jquery.data method?

0 Answers  


explain width() vs css(‘width’) in jquery

0 Answers  


How to check if number is numeric while using jquery 1.7+? : jquery mobile

0 Answers  


Jumping off of jquery ui for a second, do you 'release early, release often' with all of your projects? What are your thoughts on that strategy?

0 Answers  


How to use connect in jquery?

0 Answers  


Categories