What’s the difference between a jQuery object and a DOM element? Difference between .get() and .index()?

HTML != DOM != Javascript != jQuery, but they’re all closely related.

The browser receives an HTML document from a web server, which is just text. The browser proceeds to parse this text into an internal structure that it can actually use to render the page visually. The DOM represents that internal structure a browser has of an HTML document. Javascript (or other methods) can be used to manipulate that DOM, which in turn changes the visual render of the page. A DOM node and a DOM element are just two names for the same thing. A DOM element represents a visual or functional element on the page which was created from the original HTML document.

jQuery now is a Javascript library that makes manipulating the DOM easier than with pure Javascript by offering a number of convenience shortcuts. A jQuery object is a Javascript object, which may or may not have anything to do with the DOM (usually it does). A jQuery object is a convenience wrapper around a DOM element in Javascript which is a method to manipulate the DOM which is a representation of the page which was created from an HTML file.

Hope that helps. :o)

Leave a Comment