Definition
DOM Standard defines Element
Element includes ParentNode;
Element includes NonDocumentTypeChildNode;
Element includes ChildNode;
Element includes Slottable;
[Exposed=Window]
interface Element : Node {
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
readonly attribute DOMString tagName;
[CEReactions] attribute DOMString id;
[CEReactions] attribute DOMString className;
[SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
[CEReactions, Unscopable] attribute DOMString slot;
boolean hasAttributes();
[SameObject] readonly attribute NamedNodeMap attributes;
sequence<DOMString> getAttributeNames();
DOMString? getAttribute(DOMString qualifiedName);
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
[CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
[CEReactions] undefined removeAttribute(DOMString qualifiedName);
[CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
[CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
boolean hasAttribute(DOMString qualifiedName);
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
Attr? getAttributeNode(DOMString qualifiedName);
Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
[CEReactions] Attr? setAttributeNode(Attr attr);
[CEReactions] Attr? setAttributeNodeNS(Attr attr);
[CEReactions] Attr removeAttributeNode(Attr attr);
ShadowRoot attachShadow(ShadowRootInit init);
readonly attribute ShadowRoot? shadowRoot;
Element? closest(DOMString selectors);
boolean matches(DOMString selectors);
boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
HTMLCollection getElementsByTagName(DOMString qualifiedName);
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
[CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy
undefined insertAdjacentText(DOMString where, DOMString data); // legacy
};
This interface is extended in the following specifications:
- Fullscreen API Standard
partial interface Element { Promise<undefined> requestFullscreen(optional FullscreenOptions options = {}); attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenerror; };
- HTML Standard
partial interface Element { [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html); DOMString getHTML(optional GetHTMLOptions options = {}); [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML; [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) outerHTML; [CEReactions] undefined insertAdjacentHTML(DOMString position, (TrustedHTML or DOMString) string); };
- Element Timing API
partial interface Element { [CEReactions] attribute DOMString elementTiming; };
- CSS Spatial Navigation Level 1
partial interface Element { sequence<Node> focusableAreas(optional FocusableAreasOption option = {}); };
- CSS Pseudo-Elements Module Level 4
partial interface Element { CSSPseudoElement? pseudo(CSSOMString type); };
- CSS Regions Module Level 1
Element includes Region;
- CSS Shadow Parts
partial interface Element { [SameObject, PutForwards=value] readonly attribute DOMTokenList part; };
- CSS Typed OM Level 1
partial interface Element { [SameObject] StylePropertyMapReadOnly computedStyleMap(); };
- CSSOM View Module
partial interface Element { DOMRectList getClientRects(); [NewObject] DOMRect getBoundingClientRect(); boolean checkVisibility(optional CheckVisibilityOptions options = {}); undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); undefined scroll(optional ScrollToOptions options = {}); undefined scroll(unrestricted double x, unrestricted double y); undefined scrollTo(optional ScrollToOptions options = {}); undefined scrollTo(unrestricted double x, unrestricted double y); undefined scrollBy(optional ScrollToOptions options = {}); undefined scrollBy(unrestricted double x, unrestricted double y); attribute unrestricted double scrollTop; attribute unrestricted double scrollLeft; readonly attribute long scrollWidth; readonly attribute long scrollHeight; readonly attribute long clientTop; readonly attribute long clientLeft; readonly attribute long clientWidth; readonly attribute long clientHeight; readonly attribute double currentCSSZoom; }; // like Range Element includes GeometryUtils;
- Pointer Events
partial interface Element { undefined setPointerCapture (long pointerId); undefined releasePointerCapture (long pointerId); boolean hasPointerCapture (long pointerId); };
- Pointer Lock 2.0
partial interface Element { Promise<undefined> requestPointerLock(optional PointerLockOptions options = {}); };
- Accessible Rich Internet Applications (WAI-ARIA) 1.3
Element includes ARIAMixin;
- Web Animations
Element includes Animatable;
Consolidated IDL (across mixin and partials)
[Exposed=Window]
interface Element : Node {
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
readonly attribute DOMString tagName;
[CEReactions] attribute DOMString id;
[CEReactions] attribute DOMString className;
[SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
[CEReactions, Unscopable] attribute DOMString slot;
boolean hasAttributes();
[SameObject] readonly attribute NamedNodeMap attributes;
sequence<DOMString> getAttributeNames();
DOMString? getAttribute(DOMString qualifiedName);
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value);
[CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value);
[CEReactions] undefined removeAttribute(DOMString qualifiedName);
[CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName);
[CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
boolean hasAttribute(DOMString qualifiedName);
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
Attr? getAttributeNode(DOMString qualifiedName);
Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
[CEReactions] Attr? setAttributeNode(Attr attr);
[CEReactions] Attr? setAttributeNodeNS(Attr attr);
[CEReactions] Attr removeAttributeNode(Attr attr);
ShadowRoot attachShadow(ShadowRootInit init);
readonly attribute ShadowRoot? shadowRoot;
Element? closest(DOMString selectors);
boolean matches(DOMString selectors);
boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
HTMLCollection getElementsByTagName(DOMString qualifiedName);
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
[CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy
undefined insertAdjacentText(DOMString where, DOMString data);
[SameObject] readonly attribute HTMLCollection children;
readonly attribute Element? firstElementChild;
readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;
[CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
Element? querySelector(DOMString selectors);
[NewObject] NodeList querySelectorAll(DOMString selectors);
readonly attribute Element? previousElementSibling;
readonly attribute Element? nextElementSibling;
[CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined remove();
readonly attribute HTMLSlotElement? assignedSlot;
Promise<undefined> requestFullscreen(optional FullscreenOptions options = {});
attribute EventHandler onfullscreenchange;
attribute EventHandler onfullscreenerror;
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
DOMString getHTML(optional GetHTMLOptions options = {});
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) outerHTML;
[CEReactions] undefined insertAdjacentHTML(DOMString position, (TrustedHTML or DOMString) string);
[CEReactions] attribute DOMString elementTiming;
sequence<Node> focusableAreas(optional FocusableAreasOption option = {});
CSSPseudoElement? pseudo(CSSOMString type);
readonly attribute CSSOMString regionOverset;
sequence<Range>? getRegionFlowRanges();
[SameObject, PutForwards=value] readonly attribute DOMTokenList part;
[SameObject] StylePropertyMapReadOnly computedStyleMap();
DOMRectList getClientRects();
[NewObject] DOMRect getBoundingClientRect();
boolean checkVisibility(optional CheckVisibilityOptions options = {});
undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
undefined scroll(optional ScrollToOptions options = {});
undefined scroll(unrestricted double x, unrestricted double y);
undefined scrollTo(optional ScrollToOptions options = {});
undefined scrollTo(unrestricted double x, unrestricted double y);
undefined scrollBy(optional ScrollToOptions options = {});
undefined scrollBy(unrestricted double x, unrestricted double y);
attribute unrestricted double scrollTop;
attribute unrestricted double scrollLeft;
readonly attribute long scrollWidth;
readonly attribute long scrollHeight;
readonly attribute long clientTop;
readonly attribute long clientLeft;
readonly attribute long clientWidth;
readonly attribute long clientHeight;
readonly attribute double currentCSSZoom;
sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options = {});
DOMQuad convertQuadFromNode(DOMQuadInit quad, GeometryNode from, optional ConvertCoordinateOptions options = {});
DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options = {});
DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options = {});
undefined setPointerCapture (long pointerId);
undefined releasePointerCapture (long pointerId);
boolean hasPointerCapture (long pointerId);
Promise<undefined> requestPointerLock(optional PointerLockOptions options = {});
[CEReactions] attribute DOMString? role;
[CEReactions] attribute Element? ariaActiveDescendantElement;
[CEReactions] attribute DOMString? ariaAtomic;
[CEReactions] attribute DOMString? ariaAutoComplete;
[CEReactions] attribute DOMString? ariaBrailleLabel;
[CEReactions] attribute DOMString? ariaBrailleRoleDescription;
[CEReactions] attribute DOMString? ariaBusy;
[CEReactions] attribute DOMString? ariaChecked;
[CEReactions] attribute DOMString? ariaColCount;
[CEReactions] attribute DOMString? ariaColIndex;
[CEReactions] attribute DOMString? ariaColIndexText;
[CEReactions] attribute DOMString? ariaColSpan;
[CEReactions] attribute FrozenArray<Element>? ariaControlsElements;
[CEReactions] attribute DOMString? ariaCurrent;
[CEReactions] attribute FrozenArray<Element>? ariaDescribedByElements;
[CEReactions] attribute DOMString? ariaDescription;
[CEReactions] attribute FrozenArray<Element>? ariaDetailsElements;
[CEReactions] attribute DOMString? ariaDisabled;
[CEReactions] attribute FrozenArray<Element>? ariaErrorMessageElements;
[CEReactions] attribute DOMString? ariaExpanded;
[CEReactions] attribute FrozenArray<Element>? ariaFlowToElements;
[CEReactions] attribute DOMString? ariaHasPopup;
[CEReactions] attribute DOMString? ariaHidden;
[CEReactions] attribute DOMString? ariaInvalid;
[CEReactions] attribute DOMString? ariaKeyShortcuts;
[CEReactions] attribute DOMString? ariaLabel;
[CEReactions] attribute FrozenArray<Element>? ariaLabelledByElements;
[CEReactions] attribute DOMString? ariaLevel;
[CEReactions] attribute DOMString? ariaLive;
[CEReactions] attribute DOMString? ariaModal;
[CEReactions] attribute DOMString? ariaMultiLine;
[CEReactions] attribute DOMString? ariaMultiSelectable;
[CEReactions] attribute DOMString? ariaOrientation;
[CEReactions] attribute FrozenArray<Element>? ariaOwnsElements;
[CEReactions] attribute DOMString? ariaPlaceholder;
[CEReactions] attribute DOMString? ariaPosInSet;
[CEReactions] attribute DOMString? ariaPressed;
[CEReactions] attribute DOMString? ariaReadOnly;
[CEReactions] attribute DOMString? ariaRequired;
[CEReactions] attribute DOMString? ariaRoleDescription;
[CEReactions] attribute DOMString? ariaRowCount;
[CEReactions] attribute DOMString? ariaRowIndex;
[CEReactions] attribute DOMString? ariaRowIndexText;
[CEReactions] attribute DOMString? ariaRowSpan;
[CEReactions] attribute DOMString? ariaSelected;
[CEReactions] attribute DOMString? ariaSetSize;
[CEReactions] attribute DOMString? ariaSort;
[CEReactions] attribute DOMString? ariaValueMax;
[CEReactions] attribute DOMString? ariaValueMin;
[CEReactions] attribute DOMString? ariaValueNow;
[CEReactions] attribute DOMString? ariaValueText;
Animation animate(object? keyframes,
optional (unrestricted double or KeyframeAnimationOptions) options = {});
sequence<Animation> getAnimations(optional GetAnimationsOptions options = {}); // legacy
};
Methods and attributes that return objects implementing Element
NonElementParentNode.getElementById()
Document.documentElement
Document.createElement()
Document.createElementNS()
Document.elementFromPoint()
Document.elementsFromPoint()
Document.scrollingElement
ShadowRoot.host
ParentNode.firstElementChild
ParentNode.lastElementChild
ParentNode.querySelector()
Element.closest()
Element.insertAdjacentElement()
NonDocumentTypeChildNode.previousElementSibling
NonDocumentTypeChildNode.nextElementSibling
HTMLCollection.item()
HTMLCollection.namedItem()
Node.parentElement
Attr.ownerElement
Document.documentElement
Document.createElement()
Document.createElementNS()
Document.elementFromPoint()
Document.elementsFromPoint()
Document.scrollingElement
DocumentOrShadowRoot.fullscreenElement
DocumentOrShadowRoot.activeElement
DocumentOrShadowRoot.pictureInPictureElement
DocumentOrShadowRoot.pointerLockElement
HTMLAllCollection[index]
HTMLAllCollection.namedItem()
HTMLAllCollection.item()
HTMLFormControlsCollection.namedItem()
DocumentOrShadowRoot.fullscreenElement
DocumentOrShadowRoot.activeElement
DocumentOrShadowRoot.pictureInPictureElement
DocumentOrShadowRoot.pointerLockElement
HTMLElement.offsetParent
HTMLFormElement[index]
HTMLFormElement[name]
HTMLSlotElement.assignedElements()
PopoverInvokerElement.popoverTargetElement
Window.frameElement
PerformanceElementTiming.element
DelegatedInkTrailPresenter.presentationArea
CSSPseudoElement.element
CSSPseudoElement.parent
NamedFlow.getRegions()
NamedFlow.getRegionsByContent()
StyleSheet.ownerNode
Window.frameElement
Document.documentElement
Document.createElement()
Document.createElementNS()
Document.elementFromPoint()
Document.elementsFromPoint()
Document.scrollingElement
HTMLElement.offsetParent
IntersectionObserver.root
IntersectionObserverEntry.target
LargestContentfulPaint.element
DocumentOrShadowRoot.fullscreenElement
DocumentOrShadowRoot.activeElement
DocumentOrShadowRoot.pictureInPictureElement
DocumentOrShadowRoot.pointerLockElement
DocumentOrShadowRoot.fullscreenElement
DocumentOrShadowRoot.activeElement
DocumentOrShadowRoot.pictureInPictureElement
DocumentOrShadowRoot.pointerLockElement
ResizeObserverEntry.target
ScrollTimeline.source
ViewTimeline.subject
SVGSVGElement.getElementById()
ARIAMixin.ariaActiveDescendantElement
ARIAMixin.ariaControlsElements
ARIAMixin.ariaDescribedByElements
ARIAMixin.ariaDetailsElements
ARIAMixin.ariaErrorMessageElements
ARIAMixin.ariaFlowToElements
ARIAMixin.ariaLabelledByElements
ARIAMixin.ariaOwnsElements
KeyframeEffect.target
Referring IDL interfaces/dictionaries
ARIAMixin
Attr
CSSPseudoElement
CanvasUserInterface
CropTarget
DataTransfer
DelegatedInkTrailPresenter
Document
Document
Document
DocumentOrShadowRoot
DocumentOrShadowRoot
DocumentOrShadowRoot
DocumentOrShadowRoot
Element
HTMLAllCollection
HTMLCollection
HTMLElement
HTMLElement
HTMLFormControlsCollection
HTMLFormElement
HTMLSlotElement
InkPresenterParam
IntersectionObserver
IntersectionObserverEntry
IntersectionObserverEntryInit
IntersectionObserverInit
KeyframeEffect
LargestContentfulPaint
MathMLElement
NamedFlow
Node
NonDocumentTypeChildNode
NonElementParentNode
ParentNode
PerformanceElementTiming
PopoverInvokerElement
ResizeObserver
ResizeObserverEntry
RestrictionTarget
SVGElement
SVGSVGElement
ScrollTimeline
ScrollTimelineOptions
ShadowAnimation
ShadowRoot
StyleSheet
ViewTimeline
ViewTimelineOptions
Window
Window
XRDOMOverlayInit
Referring specifications
- Font Metrics API Level 1 refers to
Element
- Fullscreen API Standard refers to
Element
- HTML Standard refers to
Element
- Element Capture refers to
Element
- Element Timing API refers to
Element
- Ink API refers to
Element
- CSS Spatial Navigation Level 1 refers to
Element
- CSS Pseudo-Elements Module Level 4 refers to
Element
- CSS Regions Module Level 1 refers to
Element
- CSS Shadow Parts refers to
Element
- CSS Typed OM Level 1 refers to
Element
- CSS Object Model (CSSOM) refers to
Element
- CSSOM View Module refers to
Element
- Intersection Observer refers to
Element
- Largest Contentful Paint refers to
Element
- MathML Core refers to
Element
- Region Capture refers to
Element
- Picture-in-Picture refers to
Element
- Pointer Events refers to
Element
- Pointer Lock 2.0 refers to
Element
- Resize Observer refers to
Element
- Scroll-driven Animations refers to
Element
- Scalable Vector Graphics (SVG) 2 refers to
Element
- Accessible Rich Internet Applications (WAI-ARIA) 1.3 refers to
Element
- Web Animations refers to
Element
- Web Animations Level 2 refers to
Element
- WebXR DOM Overlays Module refers to
Element