Definition of HTML "element"

An element is an object in the hierarchical model of a document. It always has an element name and may also have attributes and/or child elements. The difference between an element and a tag is that an "element" is a more abstract representation of a node in the hierarchical structure of an HTML document that encompasses its attributes, child elements and other content such as text and CDATA sections. In an actual document, an element is explicitly represented by either a start tag and an end tag or closing tag enclosing its child elements and other content, if any, or simply by a standalone tag if it is a void element, which never has any content. In some cases, an element is implied even when the corresponding tag does not appear in the document. A good example of this is the tbody element, which is often an implied element between a <table> tag and a <tr> table row tag.

An element has a set of named property values, which may come from attributes or may be assumed based on default values or other elements or properties.

The term element is normally used when referring to the internal representation of an HTML object as a node in the document's hierarchical object model, encompassing all of its descendants. In contrast, the term tag typically refers to the mark up in the serialized form of an HTML document.

When referring to a node, along with any descendants, within the hierarchical object model of the internal representation of an HTML document the term element is normally used and, on this site in particular, the element name will be shown without any delimiters ("<", ">", "</" or "/>"). Those characters will only be used when discussing HTML tags, since they are used to delimit HTML code from other text in the serialized form of HTML documents.

Definition of HTML "element type"

The element type determines the meaning of a element, based on the element name, and what properties are valid for the element.