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, (TrustedType or DOMString) value);
[CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, (TrustedType or 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;
readonly attribute CustomElementRegistry? customElementRegistry;
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, Reflect] attribute DOMString elementTiming; }; - CSS Spatial Navigation Module 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 Module Level 1
partial interface Element { [SameObject, PutForwards=value] readonly attribute DOMTokenList part; }; - CSS Typed OM Level 1
partial interface Element { [SameObject] StylePropertyMapReadOnly computedStyleMap(); }; - CSS View Transitions Module Level 2
partial interface Element { ViewTransition startViewTransition( optional (ViewTransitionUpdateCallback or StartViewTransitionOptions) callbackOptions = {} ); readonly attribute ViewTransition? activeViewTransition; }; - CSSOM View Module Level 1
partial interface Element { DOMRectList getClientRects(); [NewObject] DOMRect getBoundingClientRect(); boolean checkVisibility(optional CheckVisibilityOptions options = {}); Promise<undefined> scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {}); Promise<undefined> scroll(optional ScrollToOptions options = {}); Promise<undefined> scroll(unrestricted double x, unrestricted double y); Promise<undefined> scrollTo(optional ScrollToOptions options = {}); Promise<undefined> scrollTo(unrestricted double x, unrestricted double y); Promise<undefined> scrollBy(optional ScrollToOptions options = {}); Promise<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 Module Level 1
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, (TrustedType or DOMString) value);
[CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, (TrustedType or 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;
readonly attribute CustomElementRegistry? customElementRegistry;
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);
[CEReactions] undefined moveBefore(Node node, Node? child);
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, Reflect] 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();
ViewTransition startViewTransition(
optional (ViewTransitionUpdateCallback or StartViewTransitionOptions) callbackOptions = {}
);
readonly attribute ViewTransition? activeViewTransition;
DOMRectList getClientRects();
[NewObject] DOMRect getBoundingClientRect();
boolean checkVisibility(optional CheckVisibilityOptions options = {});
Promise<undefined> scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
Promise<undefined> scroll(optional ScrollToOptions options = {});
Promise<undefined> scroll(unrestricted double x, unrestricted double y);
Promise<undefined> scrollTo(optional ScrollToOptions options = {});
Promise<undefined> scrollTo(unrestricted double x, unrestricted double y);
Promise<undefined> scrollBy(optional ScrollToOptions options = {});
Promise<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, Reflect] attribute DOMString? role;
[CEReactions, Reflect="aria-activedescendant"] attribute Element? ariaActiveDescendantElement;
[CEReactions, Reflect="aria-atomic"] attribute DOMString? ariaAtomic;
[CEReactions, Reflect="aria-autocomplete"] attribute DOMString? ariaAutoComplete;
[CEReactions, Reflect="aria-braillelabel"] attribute DOMString? ariaBrailleLabel;
[CEReactions, Reflect="aria-brailleroledescription"] attribute DOMString? ariaBrailleRoleDescription;
[CEReactions, Reflect="aria-busy"] attribute DOMString? ariaBusy;
[CEReactions, Reflect="aria-checked"] attribute DOMString? ariaChecked;
[CEReactions, Reflect="aria-colcount"] attribute DOMString? ariaColCount;
[CEReactions, Reflect="aria-colindex"] attribute DOMString? ariaColIndex;
[CEReactions, Reflect="aria-colindextext"] attribute DOMString? ariaColIndexText;
[CEReactions, Reflect="aria-colspan"] attribute DOMString? ariaColSpan;
[CEReactions, Reflect="aria-controls"] attribute FrozenArray<Element>? ariaControlsElements;
[CEReactions, Reflect="aria-current"] attribute DOMString? ariaCurrent;
[CEReactions, Reflect="aria-describedby"] attribute FrozenArray<Element>? ariaDescribedByElements;
[CEReactions, Reflect="aria-description"] attribute DOMString? ariaDescription;
[CEReactions, Reflect="aria-details"] attribute FrozenArray<Element>? ariaDetailsElements;
[CEReactions, Reflect="aria-disabled"] attribute DOMString? ariaDisabled;
[CEReactions, Reflect="aria-errormessage"] attribute FrozenArray<Element>? ariaErrorMessageElements;
[CEReactions, Reflect="aria-expanded"] attribute DOMString? ariaExpanded;
[CEReactions, Reflect="aria-flowto"] attribute FrozenArray<Element>? ariaFlowToElements;
[CEReactions, Reflect="aria-haspopup"] attribute DOMString? ariaHasPopup;
[CEReactions, Reflect="aria-hidden"] attribute DOMString? ariaHidden;
[CEReactions, Reflect="aria-invalid"] attribute DOMString? ariaInvalid;
[CEReactions, Reflect="aria-keyshortcuts"] attribute DOMString? ariaKeyShortcuts;
[CEReactions, Reflect="aria-label"] attribute DOMString? ariaLabel;
[CEReactions, Reflect="aria-labelledby"] attribute FrozenArray<Element>? ariaLabelledByElements;
[CEReactions, Reflect="aria-level"] attribute DOMString? ariaLevel;
[CEReactions, Reflect="aria-live"] attribute DOMString? ariaLive;
[CEReactions, Reflect="aria-modal"] attribute DOMString? ariaModal;
[CEReactions, Reflect="aria-multiline"] attribute DOMString? ariaMultiLine;
[CEReactions, Reflect="aria-multiselectable"] attribute DOMString? ariaMultiSelectable;
[CEReactions, Reflect="aria-orientation"] attribute DOMString? ariaOrientation;
[CEReactions, Reflect="aria-owns"] attribute FrozenArray<Element>? ariaOwnsElements;
[CEReactions, Reflect="aria-placeholder"] attribute DOMString? ariaPlaceholder;
[CEReactions, Reflect="aria-posinset"] attribute DOMString? ariaPosInSet;
[CEReactions, Reflect="aria-pressed"] attribute DOMString? ariaPressed;
[CEReactions, Reflect="aria-readonly"] attribute DOMString? ariaReadOnly;
[CEReactions, Reflect="aria-relevant"] attribute DOMString? ariaRelevant;
[CEReactions, Reflect="aria-required"] attribute DOMString? ariaRequired;
[CEReactions, Reflect="aria-roledescription"] attribute DOMString? ariaRoleDescription;
[CEReactions, Reflect="aria-rowcount"] attribute DOMString? ariaRowCount;
[CEReactions, Reflect="aria-rowindex"] attribute DOMString? ariaRowIndex;
[CEReactions, Reflect="aria-rowindextext"] attribute DOMString? ariaRowIndexText;
[CEReactions, Reflect="aria-rowspan"] attribute DOMString? ariaRowSpan;
[CEReactions, Reflect="aria-selected"] attribute DOMString? ariaSelected;
[CEReactions, Reflect="aria-setsize"] attribute DOMString? ariaSetSize;
[CEReactions, Reflect="aria-sort"] attribute DOMString? ariaSort;
[CEReactions, Reflect="aria-valuemax"] attribute DOMString? ariaValueMax;
[CEReactions, Reflect="aria-valuemin"] attribute DOMString? ariaValueMin;
[CEReactions, Reflect="aria-valuenow"] attribute DOMString? ariaValueNow;
[CEReactions, Reflect="aria-valuetext"] 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.documentElementDocument.createElement()Document.createElementNS()Document.elementFromPoint()Document.elementsFromPoint()Document.scrollingElementShadowRoot.hostParentNode.firstElementChildParentNode.lastElementChildParentNode.querySelector()Element.closest()Element.insertAdjacentElement()NonDocumentTypeChildNode.previousElementSiblingNonDocumentTypeChildNode.nextElementSiblingHTMLCollection.item()HTMLCollection.namedItem()Node.parentElementAttr.ownerElementDocument.documentElementDocument.createElement()Document.createElementNS()Document.elementFromPoint()Document.elementsFromPoint()Document.scrollingElementPointerTimeline.sourceDocumentOrShadowRoot.fullscreenElementDocumentOrShadowRoot.activeElementDocumentOrShadowRoot.pictureInPictureElementDocumentOrShadowRoot.pointerLockElementHTMLAllCollection[index]HTMLAllCollection.namedItem()HTMLAllCollection.item()HTMLFormControlsCollection.namedItem()DocumentOrShadowRoot.fullscreenElementDocumentOrShadowRoot.activeElementDocumentOrShadowRoot.pictureInPictureElementDocumentOrShadowRoot.pointerLockElementHTMLElement.scrollParentHTMLElement.offsetParentHTMLFormElement[index]HTMLFormElement[name]HTMLButtonElement.commandForElementHTMLSlotElement.assignedElements()ToggleEvent.sourceCommandEvent.sourcePopoverTargetAttributes.popoverTargetElementWindow.frameElementNavigateEvent.sourceElementPerformanceElementTiming.elementDelegatedInkTrailPresenter.presentationAreaCSSPseudoElement.elementCSSPseudoElement.parentNamedFlow.getRegions()NamedFlow.getRegionsByContent()ViewTransition.transitionRootStyleSheet.ownerNodeWindow.frameElementDocument.documentElementDocument.createElement()Document.createElementNS()Document.elementFromPoint()Document.elementsFromPoint()Document.scrollingElementHTMLElement.scrollParentHTMLElement.offsetParentIntersectionObserver.rootIntersectionObserverEntry.targetLargestContentfulPaint.elementDocumentOrShadowRoot.fullscreenElementDocumentOrShadowRoot.activeElementDocumentOrShadowRoot.pictureInPictureElementDocumentOrShadowRoot.pointerLockElementDocumentOrShadowRoot.fullscreenElementDocumentOrShadowRoot.activeElementDocumentOrShadowRoot.pictureInPictureElementDocumentOrShadowRoot.pointerLockElementResizeObserverEntry.targetScrollTimeline.sourceViewTimeline.subjectSVGSVGElement.getElementById()ARIAMixin.ariaActiveDescendantElementARIAMixin.ariaControlsElementsARIAMixin.ariaDescribedByElementsARIAMixin.ariaDetailsElementsARIAMixin.ariaErrorMessageElementsARIAMixin.ariaFlowToElementsARIAMixin.ariaLabelledByElementsARIAMixin.ariaOwnsElementsKeyframeEffect.target
Referring IDL interfaces/dictionaries
ARIAMixinAttrCSSPseudoElementCanvasUserInterfaceCommandEventCommandEventInitCropTargetDataTransferDelegatedInkTrailPresenterDocumentDocumentDocumentDocumentOrShadowRootDocumentOrShadowRootDocumentOrShadowRootDocumentOrShadowRootElementHTMLAllCollectionHTMLButtonElementHTMLCollectionHTMLElementHTMLElementHTMLFormControlsCollectionHTMLFormElementHTMLSlotElementInkPresenterParamIntersectionObserverIntersectionObserverEntryIntersectionObserverEntryInitIntersectionObserverInitKeyframeEffectLargestContentfulPaintMathMLElementNamedFlowNavigateEventNavigateEventInitNodeNonDocumentTypeChildNodeNonElementParentNodeParentNodePerformanceElementTimingPointerTimelinePointerTimelineOptionsPopoverTargetAttributesResizeObserverResizeObserverEntryRestrictionTargetSVGElementSVGSVGElementScrollTimelineScrollTimelineOptionsShadowAnimationShadowRootStyleSheetToggleEventToggleEventInitViewTimelineViewTimelineOptionsViewTransitionWindowWindowXRDOMOverlayInit
Referring specifications
- Font Metrics API Level 1 refers to
Element - Pointer-driven Animations 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 Module 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 Module Level 1 refers to
Element - CSS Typed OM Level 1 refers to
Element - CSS View Transitions Module Level 2 refers to
Element - CSS Object Model (CSSOM) Module Level 1 refers to
Element - CSSOM View Module Level 1 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 Module Level 1 refers to
Element - Scroll-driven Animations Module Level 1 refers to
Element - Scalable Vector Graphics (SVG) 2 refers to
Element - Accessible Rich Internet Applications (WAI-ARIA) 1.3 refers to
Element - Web Animations Module Level 1 refers to
Element - Web Animations Module Level 2 refers to
Element - WebXR DOM Overlays Module refers to
Element