ElementInternals
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2023.
* Some parts of this feature may have varying levels of support.
The ElementInternals interface of the Document Object Model gives web developers a way to allow custom elements to fully participate in HTML forms. It provides utilities for working with these elements in the same way you would work with any standard HTML form element, and also exposes the Accessibility Object Model to the element.
Constructor
This interface has no constructor. An ElementInternals object is returned when calling HTMLElement.attachInternals().
Instance properties
ElementInternals.shadowRootRead only-
Returns the
ShadowRootobject associated with this element. ElementInternals.formRead only-
Returns the
HTMLFormElementassociated with this element. ElementInternals.statesRead only-
Returns the
CustomStateSetassociated with this element. ElementInternals.willValidateRead only-
A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.
ElementInternals.validityRead only-
Returns a
ValidityStateobject which represents the different validity states the element can be in, with respect to constraint validation. ElementInternals.validationMessageRead only-
A string containing the validation message of this element.
ElementInternals.labelsRead only-
Returns a
NodeListof all of the label elements associated with this element.
Instance properties included from ARIA
The ElementInternals interface also includes the following properties.
Note: These are included in order that default accessibility semantics can be defined on a custom element. These may be overwritten by author-defined attributes, but ensure that default semantics are retained should the author delete those attributes, or fail to add them at all. For more information see the Accessibility Object Model explainer.
ElementInternals.ariaAtomic-
A string reflecting the
aria-atomicattribute, which indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by thearia-relevantattribute. ElementInternals.ariaAutoComplete-
A string reflecting the
aria-autocompleteattribute, which indicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox, searchbox, or textbox and specifies how predictions would be presented if they were made. ElementInternals.ariaBrailleLabel-
A string reflecting the
aria-braillelabelattribute, which defines the braille label of the element. ElementInternals.ariaBrailleRoleDescription-
A string reflecting the
aria-brailleroledescriptionattribute, which defines the ARIA braille role description of the element. ElementInternals.ariaBusy-
A string reflecting the
aria-busyattribute, which indicates whether an element is being modified, as assistive technologies may want to wait until the modifications are complete before exposing them to the user. ElementInternals.ariaChecked-
A string reflecting the
aria-checkedattribute, which indicates the current "checked" state of checkboxes, radio buttons, and other widgets that have a checked state. ElementInternals.ariaColCount-
A string reflecting the
aria-colcountattribute, which defines the number of columns in a table, grid, or treegrid. ElementInternals.ariaColIndex-
A string reflecting the
aria-colindexattribute, which defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. ElementInternals.ariaColIndexText-
A string reflecting the
aria-colindextextattribute, which defines a human-readable text alternative of aria-colindex. ElementInternals.ariaColSpan-
A string reflecting the
aria-colspanattribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. ElementInternals.ariaCurrent-
A string reflecting the
aria-currentattribute, which indicates the element that represents the current item within a container or set of related elements. ElementInternals.ariaDescription-
A string reflecting the
aria-descriptionattribute, which defines a string value that describes or annotates the current ElementInternals. ElementInternals.ariaDisabled-
A string reflecting the
aria-disabledattribute, which indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. ElementInternals.ariaExpanded-
A string reflecting the
aria-expandedattribute, which indicates whether a grouping element owned or controlled by this element is expanded or collapsed. ElementInternals.ariaHasPopup-
A string reflecting the
aria-haspopupattribute, which indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an ElementInternals. -
A string reflecting the
aria-hiddenattribute, which indicates whether the element is exposed to an accessibility API. ElementInternals.ariaInvalid-
A string reflecting the
aria-invalidattribute, which indicates the entered value does not conform to the format expected by the application. ElementInternals.ariaKeyShortcuts-
A string reflecting the
aria-keyshortcutsattribute, which indicates keyboard shortcuts that an author has implemented to activate or give focus to an object. ElementInternals.ariaLabel-
A string reflecting the
aria-labelattribute, which defines a string value that labels the current object. ElementInternals.ariaLevel-
A string reflecting the
aria-levelattribute, which defines the hierarchical level of an element within a structure. ElementInternals.ariaLive-
A string reflecting the
aria-liveattribute, which indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. ElementInternals.ariaModal-
A string reflecting the
aria-modalattribute, which indicates whether an element is modal when displayed. ElementInternals.ariaMultiline-
A string reflecting the
aria-multilineattribute, which indicates whether a text box accepts multiple lines of input or only a single line. ElementInternals.ariaMultiSelectable-
A string reflecting the
aria-multiselectableattribute, which indicates that the user may select more than one item from the current selectable descendants. ElementInternals.ariaOrientation-
A string reflecting the
aria-orientationattribute, which indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. ElementInternals.ariaPlaceholder-
A string reflecting the
aria-placeholderattribute, which defines a short hint intended to aid the user with data entry when the control has no value. ElementInternals.ariaPosInSet-
A string reflecting the
aria-posinsetattribute, which defines an element's number or position in the current set of listitems or treeitems. ElementInternals.ariaPressed-
A string reflecting the
aria-pressedattribute, which indicates the current "pressed" state of toggle buttons. ElementInternals.ariaReadOnly-
A string reflecting the
aria-readonlyattribute, which indicates that the element is not editable, but is otherwise operable. ElementInternals.ariaRelevant