ElementInternals
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.
Extends
Methods
checkValidity()
checkValidity(): boolean;
The checkValidity() method of the ElementInternals interface checks if the element meets any constraint validation rules applied to it.
Returns
boolean
reportValidity()
reportValidity(): boolean;
The reportValidity() method of the ElementInternals interface checks if the element meets any constraint validation rules applied to it.
Returns
boolean
setFormValue()
setFormValue(value, state?): void;
The setFormValue() method of the ElementInternals interface sets the element's submission value and state, communicating these to the user agent.
Parameters
| Parameter | Type |
|---|---|
value | string | FormData | File | null |
state? | string | FormData | File | null |
Returns
void
setValidity()
setValidity(
flags?,
message?,
anchor?
): void;
The setValidity() method of the ElementInternals interface sets the validity of the element.
Parameters
| Parameter | Type |
|---|---|
flags? | ValidityStateFlags |
message? | string |
anchor? | HTMLElement |
Returns
void
Properties
ariaActiveDescendantElement
ariaActiveDescendantElement: Element | null;
Inherited from
ARIAMixin.ariaActiveDescendantElement
ariaAtomic
ariaAtomic: string | null;
Inherited from
ariaAutoComplete
ariaAutoComplete: string | null;
Inherited from
ariaBrailleLabel
ariaBrailleLabel: string | null;
Inherited from
ariaBrailleRoleDescription
ariaBrailleRoleDescription: string | null;
Inherited from
ARIAMixin.ariaBrailleRoleDescription
ariaBusy
ariaBusy: string | null;
Inherited from
ariaChecked
ariaChecked: string | null;
Inherited from
ariaColCount
ariaColCount: string | null;
Inherited from
ariaColIndex
ariaColIndex: string | null;
Inherited from
ariaColIndexText
ariaColIndexText: string | null;
Inherited from
ariaColSpan
ariaColSpan: string | null;
Inherited from
ariaControlsElements
ariaControlsElements: readonly Element[] | null;
Inherited from
ARIAMixin.ariaControlsElements
ariaCurrent
ariaCurrent: string | null;
Inherited from
ariaDescribedByElements
ariaDescribedByElements: readonly Element[] | null;
Inherited from
ARIAMixin.ariaDescribedByElements
ariaDescription
ariaDescription: string | null;
Inherited from
ariaDetailsElements
ariaDetailsElements: readonly Element[] | null;
Inherited from
ariaDisabled
ariaDisabled: string | null;
Inherited from
ariaErrorMessageElements
ariaErrorMessageElements: readonly Element[] | null;
Inherited from
ARIAMixin.ariaErrorMessageElements
ariaExpanded
ariaExpanded: string | null;
Inherited from
ariaFlowToElements
ariaFlowToElements: readonly Element[] | null;
Inherited from
ariaHasPopup
ariaHasPopup: string | null;
Inherited from
ariaHidden
ariaHidden: string | null;
Inherited from
ariaInvalid
ariaInvalid: string | null;
Inherited from
ariaKeyShortcuts
ariaKeyShortcuts: string | null;
Inherited from
ariaLabel
ariaLabel: string | null;
Inherited from
ariaLabelledByElements
ariaLabelledByElements: readonly Element[] | null;
Inherited from
ARIAMixin.ariaLabelledByElements
ariaLevel
ariaLevel: string | null;
Inherited from
ariaLive
ariaLive: string | null;
Inherited from
ariaModal
ariaModal: string | null;
Inherited from
ariaMultiLine
ariaMultiLine: string | null;
Inherited from
ariaMultiSelectable
ariaMultiSelectable: string | null;
Inherited from
ariaOrientation
ariaOrientation: string | null;
Inherited from
ariaOwnsElements
ariaOwnsElements: readonly Element[] | null;
Inherited from
ariaPlaceholder
ariaPlaceholder: string | null;
Inherited from
ariaPosInSet
ariaPosInSet: string | null;
Inherited from
ariaPressed
ariaPressed: string | null;
Inherited from
ariaReadOnly
ariaReadOnly: string | null;
Inherited from
ariaRelevant
ariaRelevant: string | null;
Inherited from
ariaRequired
ariaRequired: string | null;
Inherited from
ariaRoleDescription
ariaRoleDescription: string | null;
Inherited from
ariaRowCount
ariaRowCount: string | null;
Inherited from
ariaRowIndex
ariaRowIndex: string | null;
Inherited from
ariaRowIndexText
ariaRowIndexText: string | null;
Inherited from
ariaRowSpan
ariaRowSpan: string | null;
Inherited from
ariaSelected
ariaSelected: string | null;
Inherited from
ariaSetSize
ariaSetSize: string | null;
Inherited from
ariaSort
ariaSort: string | null;
Inherited from
ariaValueMax
ariaValueMax: string | null;
Inherited from
ariaValueMin
ariaValueMin: string | null;
Inherited from
ariaValueNow
ariaValueNow: string | null;
Inherited from
ariaValueText
ariaValueText: string | null;
Inherited from
form
readonly form: HTMLFormElement | null;
The form read-only property of the ElementInternals interface returns the HTMLFormElement associated with this element.
labels
readonly labels: NodeList;
The labels read-only property of the ElementInternals interface returns the labels associated with the element.
role
role: string | null;
Inherited from
shadowRoot
readonly shadowRoot: ShadowRoot | null;
The shadowRoot read-only property of the ElementInternals interface returns the ShadowRoot for this element.
states
readonly states: CustomStateSet;
The states read-only property of the ElementInternals interface returns a CustomStateSet representing the possible states of the custom element.
validationMessage
readonly validationMessage: string;
The validationMessage read-only property of the ElementInternals interface returns the validation message for the element.
validity
readonly validity: ValidityState;
The validity read-only property of the ElementInternals interface returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.
willValidate
readonly willValidate: boolean;
The willValidate read-only property of the ElementInternals interface returns true if the element is a submittable element that is a candidate for constraint validation.