JQuery Programmer Question:

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

Tweet Share WhatsApp

Answer:

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.

Download JQuery Programmer PDF Read All 201 JQuery Programmer Questions
Previous QuestionNext Question
What are the fastest selectors in jQuery?What is finish method in jQuery?