What's the difference between a jQuery object and a DOM node?


#1

Question

What’s the difference between a jQuery object and a DOM node?

Answer

A DOM (Document Object Model) node, specifically an element node, is an interface that allows us to access and manipulate our HTML elements. In the context of comparing a jQuery object to a DOM node we can think of a DOM node as an HTML element and all the DOM properties/methods we have access to for said element.

A jQuery object is very similar a DOM node. We can think of a jQuery object as a unique wrapper for our DOM node(s), in this case whatever HTML element(s) we’re targeting, with pre-built properties/methods that make manipulating the DOM easier. However, DOM methods/properties are not available on the jQuery object.