Element Interface

Element nodes in HTML documents have properties and methods that help us locate specific elements on a webpage. Using methods such as getElementsByTagName() and getElementById(), we can easily parse the document and find what we need without searching from the root parent element.

Element

Element is the most general base class from which all element objects (i.e. objects that represent elements) in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.

For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy.

Languages outside the realm of the Web platform, like XUL through the XULElement interface, also implement Element.

Event Target <-- Node <-- Element


Source: Mozilla, https://developer.mozilla.org/en-US/docs/Web/API/Element
Creative Commons License This work is licensed under a Creative Commons Attribution 2.5 License.