Skip to content

ElementInternals

Values

checkValidity

Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. Read more on MDN

let checkValidity: WebAPI.DOMAPI.elementInternals => bool

Parameters

WebAPI.DOMAPI.elementInternals

Return type

bool

reportValidity

Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. Read more on MDN

let reportValidity: WebAPI.DOMAPI.elementInternals => bool

Parameters

WebAPI.DOMAPI.elementInternals

Return type

bool

setFormValue

Sets both the state and submission value of internals's target element to value.

If value is null, the element won't participate in form submission. Read more on MDN

let setFormValue: (
WebAPI.DOMAPI.elementInternals,
~value: unknown,
~state: unknown=?,
) => unit

Parameters

WebAPI.DOMAPI.elementInternals unknown option< unknown >

Return type

unit

setValidity

Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. Read more on MDN

let setValidity: (
WebAPI.DOMAPI.elementInternals,
~flags: WebAPI.DOMAPI.validityStateFlags=?,
~message: string=?,
~anchor: WebAPI.DOMAPI.htmlElement=?,
) => unit

Parameters

WebAPI.DOMAPI.elementInternals option< WebAPI.DOMAPI.validityStateFlags > option< string > option< WebAPI.DOMAPI.htmlElement >

Return type

unit