An element is a part of a Web page or document. In XML and HTML, an element might contain a data item or a piece of a Web page such as a chunk of text or an image. A typical element includes an opening tag, attributes, content and a closing tag.
Element and tag are often used interchangeably though they are different: the tags (opening and closing) is the way to delineate an element in the source; the element is a part of the {{Glossary("DOM")}}, the model of the document used to display the page in the browser.
See also
- The {{domxref("Element")}} interface, representing an element in the DOM.
- More details about elements.