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


Please Help Members By Posting Answers For Below Questions

What is serialize() in jquery?

595


Explain the concepts of "$ function" in jquery with an example?

670


How do you select all elements with the class of “selected” in jquery?

594


Why are not some scripts and styles loading? : jquery mobile

587


What is the between $(this) and 'this' in jquery?

617


How to find all sibling elements after the current element using ?

632


Explain .delegate()? : jquery mobile

621


Explain url paremeter of jquery ajax method?

8752


Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?

642


What are the the two types of cdns?

631


What is jQuery CDN?

653


What is meant by the term ‘theming’ in jquery mobile? : jQuery Mobile

583


What is called chaining?

637


What's next on the hitlist with jquery ui?

643


Whether C# code behind can be called from jQuery?

636