ElementInternals

The ElementInternals interface of the Document Object Model gives web developers a way to allow custom elements to fully participate in HTML forms.

MDN Reference

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The form read-only property of the ElementInternals interface returns the HTMLFormElement associated with this element.

Link copied to clipboard

The labels read-only property of the ElementInternals interface returns the labels associated with the element.

Link copied to clipboard
Link copied to clipboard

The shadowRoot read-only property of the ElementInternals interface returns the ShadowRoot for this element.

Link copied to clipboard

The states read-only property of the ElementInternals interface returns a CustomStateSet representing the possible states of the custom element.

Link copied to clipboard
open override val validationMessage: String

The validationMessage read-only property of the ElementInternals interface returns the validation message for the element.

Link copied to clipboard
open override val 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.

Link copied to clipboard
open override val 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.

Functions

Link copied to clipboard
open override fun checkValidity(): Boolean

The checkValidity() method of the ElementInternals interface checks if the element meets any constraint validation rules applied to it.

Link copied to clipboard
open override fun reportValidity(): Boolean

The reportValidity() method of the ElementInternals interface checks if the element meets any constraint validation rules applied to it.

Link copied to clipboard
fun setFormValue(value: String?, state: String? = definedExternally)
fun setFormValue(value: FormData?, state: FormData? = definedExternally)

fun setFormValue(value: File?, state: File? = definedExternally)

The setFormValue() method of the ElementInternals interface sets the element's submission value and state, communicating these to the user agent.

Link copied to clipboard
fun setValidity(flags: ValidityStateFlags = definedExternally, message: String = definedExternally, anchor: HTMLElement = definedExternally)

The setValidity() method of the ElementInternals interface sets the validity of the element.