--- title: Element slug: Web/API/Element tags: - API - DOM - DOM Reference - Element - Interface - NeedsTranslation - Reference - TopicStub - Web API translation_of: Web/API/Element ---
{{APIRef("DOM")}}

Element is the most general base class from which all objects in a {{DOMxRef("Document")}} inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. For example, the {{DOMxRef("HTMLElement")}} interface is the base interface for HTML elements, while the {{DOMxRef("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.

{{InheritanceDiagram}}

Properties

Inherits properties from its parent interface, {{DOMxRef("Node")}}, and by extension that interface's parent, {{DOMxRef("EventTarget")}}. It implements the properties of {{DOMxRef("ParentNode")}}, {{DOMxRef("ChildNode")}}, {{DOMxRef("NonDocumentTypeChildNode")}}, and {{DOMxRef("Animatable")}}.

{{DOMxRef("Element.attributes")}} {{readOnlyInline}}
Returns a {{DOMxRef("NamedNodeMap")}} object containing the assigned attributes of the corresponding HTML element.
{{DOMxRef("Element.classList")}} {{readOnlyInline}}
Returns a {{DOMxRef("DOMTokenList")}} containing the list of class attributes.
{{DOMxRef("Element.className")}}
Is a {{DOMxRef("DOMString")}} representing the class of the element.
{{DOMxRef("Element.clientHeight")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the inner height of the element.
{{DOMxRef("Element.clientLeft")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the width of the left border of the element.
{{DOMxRef("Element.clientTop")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the width of the top border of the element.
{{DOMxRef("Element.clientWidth")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the inner width of the element.
{{DOMxRef("Element.computedName")}} {{readOnlyInline}}
Returns a {{DOMxRef("DOMString")}} containing the label exposed to accessibility.
{{DOMxRef("Element.computedRole")}} {{readOnlyInline}}
Returns a {{DOMxRef("DOMString")}} containing the ARIA role that has been applied to a particular element. 
{{DOMxRef("Element.id")}}
Is a {{DOMxRef("DOMString")}} representing the id of the element.
{{DOMxRef("Element.innerHTML")}}
Is a {{DOMxRef("DOMString")}} representing the markup of the element's content.
{{DOMxRef("Element.localName")}} {{readOnlyInline}}
A {{DOMxRef("DOMString")}} representing the local part of the qualified name of the element.
{{DOMxRef("Element.namespaceURI")}} {{readonlyInline}}
The namespace URI of the element, or null if it is no namespace.

Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the http://www.w3.org/1999/xhtml namespace in both HTML and XML trees. {{ gecko_minversion_inline("1.9.2")}}

{{DOMxRef("NonDocumentTypeChildNode.nextElementSibling")}} {{readOnlyInline}}
Is an {{DOMxRef("Element")}}, the element immediately following the given one in the tree, or null if there's no sibling node.
{{DOMxRef("Element.outerHTML")}}
Is a {{DOMxRef("DOMString")}} representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
{{DOMxRef("Element.prefix")}} {{readOnlyInline}}
A {{DOMxRef("DOMString")}} representing the namespace prefix of the element, or null if no prefix is specified.
{{DOMxRef("NonDocumentTypeChildNode.previousElementSibling")}} {{readOnlyInline}}
Is a {{DOMxRef("Element")}}, the element immediately preceding the given one in the tree, or null if there is no sibling element.
{{DOMxRef("Element.scrollHeight")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the scroll view height of an element.
{{DOMxRef("Element.scrollLeft")}}
Is a {{jsxref("Number")}} representing the left scroll offset of the element.
{{DOMxRef("Element.scrollLeftMax")}} {{Non-standard_Inline}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the maximum left scroll offset possible for the element.
{{DOMxRef("Element.scrollTop")}}
A {{jsxref("Number")}} representing number of pixels the top of the document is scrolled vertically.
{{DOMxRef("Element.scrollTopMax")}} {{Non-standard_Inline}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the maximum top scroll offset possible for the element.
{{DOMxRef("Element.scrollWidth")}} {{readOnlyInline}}
Returns a {{jsxref("Number")}} representing the scroll view width of the element.
{{DOMxRef("Element.shadowRoot")}}{{readOnlyInline}}
Returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
{{DOMxRef("Element.openOrClosedShadowRoot")}} {{Non-standard_Inline}}{{readOnlyInline}}
Returns the shadow root that is hosted by the element, regardless if its open or closed. Available only to WebExtensions.
{{DOMxRef("Element.slot")}} {{Experimental_Inline}}
Returns the name of the shadow DOM slot the element is inserted in.
{{DOMxRef("Element.tabStop")}} {{Non-standard_Inline}}
Is a {{jsxref("Boolean")}} indicating if the element can receive input focus via the tab key.
{{DOMxRef("Element.tagName")}} {{readOnlyInline}}
Returns a {{jsxref("String")}} with the name of the tag for the given element.
{{DOMxRef("Element.undoManager")}} {{Experimental_Inline}} {{readOnlyInline}}
Returns the {{DOMxRef("UndoManager")}} associated with the element.
{{DOMxRef("Element.undoScope")}} {{Experimental_Inline}}
Is a {{jsxref("Boolean")}} indicating if the element is an undo scope host, or not.

Note: DOM Level 3 defined namespaceURI, localName and prefix on the {{DOMxRef("Node")}} interface. In DOM4 they were moved to Element.

This change is implemented in Chrome since version 46.0 and Firefox since version 48.0.

Properties included from Slotable

The Element interface includes the following property, defined on the {{DOMxRef("Slotable")}} mixin.

{{DOMxRef("Slotable.assignedSlot")}}{{readonlyInline}}
Returns a {{DOMxRef("HTMLSlotElement")}} representing the {{htmlelement("slot")}} the node is inserted in.

Event handlers

{{domxref("Element.onfullscreenchange")}}
An event handler for the {{event("fullscreenchange")}} event, which is sent when the element enters or exits full-screen mode. This can be used to watch both for successful expected transitions, but also to watch for unexpected changes, such as when your app is backgrounded.
{{domxref("Element.onfullscreenerror")}}
An event handler for the {{event("fullscreenerror")}} event, which is sent when an error occurs while attempting to change into full-screen mode.

Methods

Inherits methods from its parents {{DOMxRef("Node")}}, and its own parent, {{DOMxRef("EventTarget")}}, and implements those of {{DOMxRef("ParentNode")}}, {{DOMxRef("ChildNode")}}, {{DOMxRef("NonDocumentTypeChildNode")}}, and {{DOMxRef("Animatable")}}.

{{DOMxRef("EventTarget.addEventListener()")}}
Registers an event handler to a specific event type on the element.
{{DOMxRef("Element.attachShadow()")}}
Attatches a shadow DOM tree to the specified element and returns a reference to its {{DOMxRef("ShadowRoot")}}.
{{DOMxRef("Element.animate()")}} {{Experimental_Inline}}
A shortcut method to create and run an animation on an element. Returns the created Animation object instance.
{{DOMxRef("Element.closest()")}} {{Experimental_Inline}}
Returns the {{DOMxRef("Element")}} which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter.
{{DOMxRef("Element.createShadowRoot()")}} {{Non-standard_Inline}} {{Deprecated_Inline}}
Creates a shadow DOM on on the element, turning it into a shadow host. Returns a {{DOMxRef("ShadowRoot")}}.
{{DOMxRef("Element.computedStyleMap()")}} {{Experimental_Inline}}
Returns a {{DOMxRef("StylePropertyMapReadOnly")}} interface which provides a read-only representation of a CSS declaration block that is an alternative to {{DOMxRef("CSSStyleDeclaration")}}.
{{DOMxRef("EventTarget.dispatchEvent()")}}
Dispatches an event to this node in the DOM and returns a {{jsxref("Boolean")}} that indicates whether no handler canceled the event.
{{DOMxRef("Element.getAnimations()")}} {{Experimental_Inline}}
Returns an array of Animation objects currently active on the element.
{{DOMxRef("Element.getAttribute()")}}
Retrieves the value of the named attribute from the current node and returns it as an {{jsxref("Object")}}.
{{DOMxRef("Element.getAttributeNames()")}}
Returns an array of attribute names from the current element.
{{DOMxRef("Element.getAttributeNS()")}}
Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an {{jsxref("Object")}}.
{{DOMxRef("Element.getAttributeNode()")}} {{Obsolete_Inline}}
Retrieves the node representation of the named attribute from the current node and returns it as an {{DOMxRef("Attr")}}.
{{DOMxRef("Element.getAttributeNodeNS()")}} {{Obsolete_Inline}}
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an {{DOMxRef("Attr")}}.
{{DOMxRef("Element.getBoundingClientRect()")}}
Returns the size of an element and its position relative to the viewport.
{{DOMxRef("Element.getClientRects()")}}
Returns a collection of rectangles that indicate the bounding rectangles for each line of text in a client.
{{DOMxRef("Element.getElementsByClassName()")}}
Returns a live {{DOMxRef("HTMLCollection")}} that contains all descendants of the current element that possess the list of classes given in the parameter.
{{DOMxRef("Element.getElementsByTagName()")}}
Returns a live {{DOMxRef("HTMLCollection")}} containing all descendant elements, of a particular tag name, from the current element.
{{DOMxRef("Element.getElementsByTagNameNS()")}}
Returns a live {{DOMxRef("HTMLCollection")}} containing all descendant elements, of a particular tag name and namespace, from the current element.
{{DOMxRef("Element.hasAttribute()")}}
Returns a {{jsxref("Boolean")}} indicating if the element has the specified attribute or not.
{{DOMxRef("Element.hasAttributeNS()")}}
Returns a {{jsxref("Boolean")}} indicating if the element has the specified attribute, in the specified namespace, or not.
{{DOMxRef("Element.hasAttributes()")}}
Returns a {{jsxref("Boolean")}} indicating if the element has one or more HTML attributes present.
{{DOMxRef("Element.hasPointerCapture()")}}
Indicates whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID.
{{DOMxRef("Element.insertAdjacentElement()")}}
Inserts a given element node at a given position relative to the element it is invoked upon.
{{DOMxRef("Element.insertAdjacentHTML()")}}
Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.
{{DOMxRef("Element.insertAdjacentText()")}}
Inserts a given text node at a given position relative to the element it is invoked upon.
{{DOMxRef("Element.matches()")}} {{Experimental_Inline}}
Returns a {{jsxref("Boolean")}} indicating whether or not the element would be selected by the specified selector string.
{{DOMxRef("Element.querySelector()")}}
Returns the first {{DOMxRef("Node")}} which matches the specified selector string relative to the element.
{{DOMxRef("Element.querySelectorAll()")}}
Returns a {{DOMxRef("NodeList")}} of nodes which match the specified selector string relative to the element.
{{DOMxRef("Element.releasePointerCapture()")}}
Releases (stops) pointer capture that was previously set for a specific {{DOMxRef("PointerEvent","pointer event")}}.
{{DOMxRef("ChildNode.remove()")}} {{Experimental_Inline}}
Removes the element from the children list of its parent.
{{DOMxRef("Element.removeAttribute()")}}
Removes the named attribute from the current node.
{{DOMxRef("Element.removeAttributeNS()")}}
Removes the attribute with the specified name and namespace, from the current node.
{{DOMxRef("Element.removeAttributeNode()")}} {{Obsolete_Inline}}
Removes the node representation of the named attribute from the current node.
{{DOMxRef("EventTarget.removeEventListener()")}}
Removes an event listener from the element.
{{DOMxRef("Element.requestFullscreen()")}} {{Experimental_Inline}}
Asynchronously asks the browser to make the element full-screen.
{{DOMxRef("Element.requestPointerLock()")}} {{Experimental_Inline}}
Allows to asynchronously ask for the pointer to be locked on the given element.
{{domxref("Element.scroll()")}}
Scrolls to a particular set of coordinates inside a given element.
{{domxref("Element.scrollBy()")}}
Scrolls an element by the given amount.
{{DOMxRef("Element.scrollIntoView()")}} {{Experimental_Inline}}
Scrolls the page until the element gets into the view.
{{domxref("Element.scrollTo()")}}
Scrolls to a particular set of coordinates inside a given element.
{{DOMxRef("Element.setAttribute()")}}
Sets the value of a named attribute of the current node.
{{DOMxRef("Element.setAttributeNS()")}}
Sets the value of the attribute with the specified name and namespace, from the current node.
{{DOMxRef("Element.setAttributeNode()")}} {{Obsolete_Inline}}
Sets the node representation of the named attribute from the current node.
{{DOMxRef("Element.setAttributeNodeNS()")}} {{Obsolete_Inline}}
Sets the node representation of the attribute with the specified name and namespace, from the current node.
{{DOMxRef("Element.setCapture()")}} {{Non-standard_Inline}}
Sets up mouse event capture, redirecting all mouse events to this element.
{{DOMxRef("Element.setPointerCapture()")}}
Designates a specific element as the capture target of future pointer events.
{{DOMxRef("Element.toggleAttribute()")}}
Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element.

Events

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

{{domxref("Element/cancel_event", "cancel")}}
Fires on a {{HTMLElement("dialog")}} when the user instructs the browser that they wish to dismiss the current open dialog. For example, the browser might fire this event when the user presses the Esc key or clicks a "Close dialog" button which is part of the browser's UI.
Also available via the {{domxref("GlobalEventHandlers/oncancel", "oncancel")}} property.
error
Fired when when a resource failed to load, or can't be used. For example, if a script has an execution error or an image can't be found or is invalid.
Also available via the {{domxref("GlobalEventHandlers/onerror", "onerror")}} property.
{{domxref("Element/scroll_event", "scroll")}}
Fired when the document view or an element has been scrolled.
Also available via the {{DOMxRef("GlobalEventHandlers.onscroll", "onscroll")}} property.
{{domxref("Element/select_event", "select")}}
Fired when some text has been selected.
Also available via the {{DOMxRef("GlobalEventHandlers.onselect", "onselect")}} property.
{{domxref("Element/show_event", "show")}}
Fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute. {{deprecated_inline}}
Also available via the {{DOMxRef("GlobalEventHandlers.onshow", "onshow")}} property.
{{domxref("Element/wheel_event","wheel")}}
Fired when the user rotates a wheel button on a pointing device (typically a mouse).
Also available via the {{DOMxRef("GlobalEventHandlers.onwheel", "onwheel")}} property.

Clipboard events

{{domxref("Element/copy_event", "copy")}}
Fired when the user initiates a copy action through the browser's user interface.
Also available via the {{domxref("HTMLElement/oncopy", "oncopy")}} property.
{{domxref("Element/cut_event", "cut")}}
Fired when the user initiates a cut action through the browser's user interface.
Also available via the {{domxref("HTMLElement/oncut", "oncut")}} property.
{{domxref("Element/paste_event", "paste")}}
Fired when the user initiates a paste action through the browser's user interface.
Also available via the {{domxref("HTMLElement/onpaste", "onpaste")}} property.

Composition events

{{domxref("Element/compositionend_event", "compositionend")}}
Fired when a text composition system such as an {{glossary("input method editor")}} completes or cancels the current composition session.
{{domxref("Element/compositionstart_event", "compositionstart")}}
Fired when a text composition system such as an {{glossary("input method editor")}} starts a new composition session.
{{domxref("Element/compositionupdate_event", "compositionupdate")}}
Fired when a new character is received in the context of a text composition session controlled by a text composition system such as an {{glossary("input method editor")}}.

Focus events

{{domxref("Element/blur_event", "blur")}}
Fired when an element has lost focus.
Also available via the {{domxref("GlobalEventHandlers/onblur", "onblur")}} property.
{{domxref("Element/focus_event", "focus")}}
Fired when an element has gained focus.
Also available via the {{domxref("GlobalEventHandlers/onfocus", "onfocus")}} property
{{domxref("Element/focusin_event", "focusin")}}
Fired when an element is about to gain focus.
{{domxref("Element/focusout_event", "focusout")}}
Fired when an element is about to lose focus.

Fullscreen events

{{domxref("Element/fullscreenchange_event", "fullscreenchange")}}
Sent to an {{domxref("Element")}} when it transitions into or out of full-screen mode.
Also available via the {{domxref("Element.onfullscreenchange", "onfullscreenchange")}}  property.
{{domxref("Element/fullscreenerror_event", "fullscreenerror")}}
Sent to an Element if an error occurs while attempting to switch it into or out of full-screen mode.
Also available via the {{domxref("Element.onfullscreenerror", "onfullscreenerror")}} property.

Keyboard events

{{domxref("Element/keydown_event", "keydown")}}
Fired when a key is pressed.
Also available via the {{domxref("GlobalEventHandlers/onkeydown", "onkeydown")}} property.
{{domxref("Element/keypress_event", "keypress")}}
Fired when a key that produces a character value is pressed down. {{deprecated_inline}}
Also available via the {{domxref("GlobalEventHandlers/onkeypress", "onkeypress")}} property.
{{domxref("Element/keyup_event", "keyup")}}
Fired when a key is released.
Also available via the {{domxref("GlobalEventHandlers/onkeyup", "onkeyup")}} property.

Mouse events

{{domxref("Element/Activate_event", "Activate")}}
Occurs when an element is activated, for instance, through a mouse click or a keypress.
Also available via the {{domxref("ServiceWorkerGlobalScope/onactivate", "onactivate")}} property.
{{domxref("Element/auxclick_event", "auxclick")}}
Fired when a non-primary pointing device button (e.g., any mouse button other than the left button) has been pressed and released on an element.
Also available via the {{domxref("GlobalEventHandlers/onauxclick", "onauxclick")}} property.
{{domxref("Element/click_event", "click")}}
Fired when a pointing device button (e.g., a mouse's primary button) is pressed and released on a single element.
Also available via the {{domxref("GlobalEventHandlers/onclick", "onclick")}} property.
{{domxref("Element/contextmenu_event", "contextmenu")}}
Fired when the user attempts to open a context menu.
Also available via the {{domxref("GlobalEventHandlers/oncontextmenu", "oncontextmenu")}} property.
{{domxref("Element/dblclick_event", "dblclick")}}
Fired when a pointing device button (e.g., a mouse's primary button) is clicked twice on a single element.
Also available via the {{domxref("GlobalEventHandlers/ondblclick", "ondblclick")}} property.
{{domxref("Element/mousedown_event", "mousedown")}}
Fired when a pointing device button is pressed on an element.
Also available via the {{domxref("GlobalEventHandlers/onmousedown", "onmousedown")}} property.
{{domxref("Element/mouseenter_event", "mouseenter")}}
Fired when a pointing device (usually a mouse) is moved over the element that has the listener attached.
Also available via the {{domxref("GlobalEventHandlers/onmouseenter", "onmouseenter")}} property.
{{domxref("Element/mouseleave_event", "mouseleave")}}
Fired when the pointer of a pointing device (usually a mouse) is moved out of an element that has the listener attached to it.
Also available via the {{domxref("GlobalEventHandlers/onmouseleave", "onmouseleave")}} property.
{{domxref("Element/mousemove_event", "mousemove")}}
Fired when a pointing device (usually a mouse) is moved while over an element.
Also available via the {{domxref("GlobalEventHandlers/onmousemove", "onmousemove")}} property.
{{domxref("Element/mouseout_event", "mouseout")}}
Fired when a pointing device (usually a mouse) is moved off the element to which the listener is attached or off one of its children.
Also available via the {{domxref("GlobalEventHandlers/onmouseout", "onmouseout")}} property.
{{domxref("Element/mouseover_event", "mouseover")}}
Fired when a pointing device is moved onto the element to which the listener is attached or onto one of its children.
Also available via the {{domxref("GlobalEventHandlers/onmouseover", "onmouseover")}} property.
{{domxref("Element/mouseup_event", "mouseup")}}
Fired when a pointing device button is released on an element.
Also available via the {{domxref("GlobalEventHandlers/onmouseup", "onmouseup")}} property.
{{domxref("Element/webkitmouseforcechanged_event", "webkitmouseforcechanged")}}
Fired each time the amount of pressure changes on the trackpadtouchscreen.
{{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}}
Fired after the mousedown event as soon as sufficient pressure has been applied to qualify as a "force click".
{{domxref("Element/webkitmouseforcewillbegin_event", "webkitmouseforcewillbegin")}}
Fired before the {{domxref("Element/mousedown_event", "mousedown")}} event.
{{domxref("Element/webkitmouseforceup_event", "webkitmouseforceup")}}
Fired after the {{domxref("Element/webkitmouseforcedown_event", "webkitmouseforcedown")}} event as soon as the pressure has been reduced sufficiently to end the "force click".

Touch events

{{domxref("Element/touchcancel_event", "touchcancel")}}
Fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).
Also available via the {{domxref("GlobalEventHandlers/ontouchcancel", "ontouchcancel")}} property.
{{domxref("Element/touchend_event", "touchend")}}
Fired when one or more touch points are removed from the touch surface.
Also available via the {{domxref("GlobalEventHandlers/ontouchend", "ontouchend")}} property
{{domxref("Element/touchmove_event", "touchmove")}}
Fired when one or more touch points are moved along the touch surface.
Also available via the {{domxref("GlobalEventHandlers/ontouchmove", "ontouchmove")}} property
{{domxref("Element/touchstart_event", "touchstart")}}
Fired when one or more touch points are placed on the touch surface.
Also available via the {{domxref("GlobalEventHandlers/ontouchstart", "ontouchstart")}} property
 

Specifications

Specification Status Comment
{{SpecName("Web Animations", '', '')}} {{Spec2("Web Animations")}} Added the getAnimations() method.
{{SpecName('Undo Manager', '', 'Element')}} {{Spec2('Undo Manager')}} Added the undoScope and undoManager properties.
{{SpecName('Pointer Events 2', '#extensions-to-the-element-interface', 'Element')}} {{Spec2('Pointer Events 2')}} Added the following event handlers: ongotpointercapture and onlostpointercapture.
Added the following methods: setPointerCapture() and releasePointerCapture().
{{SpecName('Pointer Events', '#extensions-to-the-element-interface', 'Element')}} {{Spec2('Pointer Events')}} Added the following event handlers: ongotpointercapture and onlostpointercapture.
Added the following methods: setPointerCapture() and releasePointerCapture().
{{SpecName('Selectors API Level 1', '#interface-definitions', 'Element')}} {{Spec2('Selectors API Level 1')}} Added the following methods: querySelector() and querySelectorAll().
{{SpecName('Pointer Lock', 'index.html#element-interface', 'Element')}} {{Spec2('Pointer Lock')}} Added the requestPointerLock() method.
{{SpecName('Fullscreen', '#api', 'Element')}} {{Spec2('Fullscreen')}} Added the requestFullscreen() method.
{{SpecName('DOM Parsing', '#extensions-to-the-element-interface', 'Element')}} {{Spec2('DOM Parsing')}} Added the following properties: innerHTML, and outerHTML.
Added the following method: insertAdjacentHTML().
{{SpecName('CSSOM View', '#extensions-to-the-element-interface', 'Element')}} {{Spec2('CSSOM View')}} Added the following properties: scrollTop, scrollLeft, scrollWidth, scrollHeight, clientTop, clientLeft, clientWidth, and clientHeight.
Added the following methods: getClientRects(), getBoundingClientRect(), scroll()scrollBy(), scrollTo() and scrollIntoView().
{{SpecName('Element Traversal', '#ecmascript-bindings', 'Element')}} {{Spec2('Element Traversal')}} Added inheritance of the {{DOMxRef("ElementTraversal")}} interface.
{{SpecName('DOM WHATWG', '#interface-element', 'Element')}} {{Spec2('DOM WHATWG')}} Added the following methods: closest(), insertAdjacentElement() and insertAdjacentText().
Moved hasAttributes() from the Node interface to this one.
{{SpecName("DOM4", "#interface-element", "Element")}} {{Spec2("DOM4")}} Removed the following methods: setIdAttribute(), setIdAttributeNS(), and setIdAttributeNode().
Modified the return value of getElementsByTagName() and getElementsByTagNameNS().
Removed the schemaTypeInfo property.
{{SpecName('DOM3 Core', 'core.html#ID-745549614', 'Element')}} {{Spec2('DOM3 Core')}} Added the following methods: setIdAttribute(), setIdAttributeNS(), and setIdAttributeNode(). These methods were never implemented and have been removed in later specifications.
Added the schemaTypeInfo property. This property was never implemented and has been removed in later specifications.
{{SpecName('DOM2 Core', 'core.html#ID-745549614', 'Element')}} {{Spec2('DOM2 Core')}} The normalize() method has been moved to {{DOMxRef("Node")}}.
{{SpecName('DOM1', 'level-one-core.html#ID-745549614', 'Element')}} {{Spec2('DOM1')}} Initial definition.

Browser compatibility

{{Compat("api.Element")}}