Skip to content

HTMLInputElement

Types

getRootNodeOptions

type getRootNodeOptions = {mutable composed?: bool}

Record fields

composed
option<bool>

t

Provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. See HTMLInputElement on MDN TODO: mark as private once mutating fields of private records is allowed

type t = {
namespaceURI: Null.t<string>,
prefix: Null.t<string>,
localName: string,
tagName: string,
mutable id: string,
mutable className: string,
classList: WebAPI.DOM.domTokenList,
mutable slot: string,
attributes: WebAPI.DOM.namedNodeMap,
shadowRoot: Null.t<WebAPI.DOMTree.shadowRoot>,
part: WebAPI.DOM.domTokenList,
mutable scrollTop: float,
mutable scrollLeft: float,
scrollWidth: int,
scrollHeight: int,
clientTop: int,
clientLeft: int,
clientWidth: int,
clientHeight: int,
currentCSSZoom: float,
mutable innerHTML: string,
mutable outerHTML: string,
nodeType: int,
nodeName: string,
baseURI: string,
isConnected: bool,
ownerDocument: Null.t<WebAPI.DOM.document>,
parentNode: Null.t<WebAPI.DOMTree.node>,
parentElement: Null.t<WebAPI.DOMTree.htmlElement>,
childNodes: WebAPI.DOM.nodeList<WebAPI.DOMTree.node>,
firstChild: Null.t<WebAPI.DOMTree.node>,
lastChild: Null.t<WebAPI.DOMTree.node>,
previousSibling: Null.t<WebAPI.DOMTree.node>,
nextSibling: Null.t<WebAPI.DOMTree.node>,
mutable nodeValue: Null.t<string>,
mutable textContent: Null.t<string>,
mutable title: string,
mutable lang: string,
mutable translate: bool,
mutable dir: string,
mutable inert: bool,
mutable accessKey: string,
accessKeyLabel: string,
mutable draggable: bool,
mutable spellcheck: bool,
mutable autocapitalize: string,
mutable innerText: string,
mutable outerText: string,
mutable popover: Null.t<string>,
offsetParent: Null.t<WebAPI.DOMTree.element>,
offsetTop: int,
offsetLeft: int,
offsetWidth: int,
offsetHeight: int,
style: WebAPI.CSSStyleDeclaration.t,
attributeStyleMap: WebAPI.StylePropertyMap.t,
mutable contentEditable: string,
mutable enterKeyHint: string,
isContentEditable: bool,
mutable inputMode: string,
dataset: WebAPI.DOMStringMap.t,
mutable nonce?: string,
mutable autofocus: bool,
mutable tabIndex: int,
mutable accept: string,
mutable alt: string,
mutable autocomplete: string,
mutable defaultChecked: bool,
mutable checked: bool,
mutable disabled: bool,
form: Null.t<WebAPI.DOMTree.htmlFormElement>,
mutable files: Null.t<WebAPI.DOM.fileList>,
mutable formAction: string,
mutable formEnctype: string,
mutable formMethod: string,
mutable height: int,
mutable indeterminate: bool,
list: Null.t<WebAPI.HTMLDataListElement.t>,
mutable max: string,
mutable maxLength: int,
mutable min: string,
mutable minLength: int,
mutable multiple: bool,
mutable name: string,
mutable pattern: string,
mutable placeholder: string,
mutable readOnly: bool,
mutable required: bool,
mutable size: int,
mutable src: string,
mutable step: string,
mutable type_: string,
mutable defaultValue: string,
mutable value: string,
mutable valueAsDate: Null.t<Date.t>,
mutable valueAsNumber: float,
mutable width: int,
willValidate: bool,
validity: WebAPI.DOM.validityState,
validationMessage: string,
labels: Null.t<
WebAPI.DOM.nodeList<WebAPI.HTMLLabelElement.t>,
>,
mutable selectionStart: Null.t<int>,
mutable selectionEnd: Null.t<int>,
mutable selectionDirection: Null.t<string>,
mutable webkitdirectory: bool,
webkitEntries: array<
WebAPI.BaseFileAndDirectoryEntries.fileSystemEntry,
>,
mutable capture: string,
mutable popoverTargetElement: Null.t<
WebAPI.DOMTree.element,
>,
mutable popoverTargetAction: string,
}

Record fields

namespaceURI
Null.t<string>

Returns the namespace. Read more on MDN

prefix
Null.t<string>

Returns the namespace prefix. Read more on MDN

localName
string

Returns the local name. Read more on MDN

tagName
string

Returns the HTML-uppercased qualified name. Read more on MDN

id
string

Returns the value of element's id content attribute. Can be set to change it. Read more on MDN

className
string

Returns the value of element's class content attribute. Can be set to change it. Read more on MDN

classList

Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. Read more on MDN

slot
string

Returns the value of element's slot content attribute. Can be set to change it. Read more on MDN

shadowRoot

Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. Read more on MDN

scrollTop
float
scrollLeft
float
scrollWidth
int
scrollHeight
int
clientTop
int
clientLeft
int
clientWidth
int
clientHeight
int
currentCSSZoom
float
innerHTML
string
outerHTML
string
nodeType
int

Returns the type of node. Read more on MDN

nodeName
string

Returns a string appropriate for the type of node. Read more on MDN

baseURI
string

Returns node's node document's document base URL. Read more on MDN

isConnected
bool

Returns true if node is connected and false otherwise. Read more on MDN

ownerDocument

Returns the node document. Returns null for documents. Read more on MDN

parentNode

Returns the parent. Read more on MDN

parentElement

Returns the parent element. Read more on MDN

firstChild

Returns the first child. Read more on MDN

lastChild

Returns the last child. Read more on MDN

previousSibling

Returns the previous sibling. Read more on MDN

nextSibling

Returns the next sibling. Read more on MDN

nodeValue
Null.t<string>
textContent
Null.t<string>
title
string
translate
bool
accessKey
string
accessKeyLabel
string
draggable
bool
spellcheck
bool
autocapitalize
string
innerText
string
outerText
string
popover
Null.t<string>
offsetTop
int
offsetLeft
int
offsetWidth
int
offsetHeight
int
contentEditable
string
enterKeyHint
string
isContentEditable
bool
inputMode
string
nonce
option<string>
autofocus
bool
tabIndex
int
accept
string

Sets or retrieves a comma-separated list of content types. Read more on MDN

alt
string

Sets or retrieves a text alternative to the graphic. Read more on MDN

autocomplete
string

Specifies whether autocomplete is applied to an editable text field. Read more on MDN

defaultChecked
bool

Sets or retrieves the state of the check box or radio button. Read more on MDN

checked
bool

Sets or retrieves the state of the check box or radio button. Read more on MDN

disabled
bool
form

Retrieves a reference to the form that the object is embedded in. Read more on MDN

files

Returns a FileList object on a file type input object. Read more on MDN

formAction
string

Overrides the action attribute (where the data on a form is sent) on the parent form element. Read more on MDN

formEnctype
string

Used to override the encoding (formEnctype attribute) specified on the form element. Read more on MDN

formMethod
string

Overrides the submit method attribute previously specified on a form element. Read more on MDN

height
int

Sets or retrieves the height of the object. Read more on MDN

indeterminate
bool

When set, overrides the rendering of checkbox controls so that the current value is not visible. Read more on MDN

list

Specifies the ID of a pre-defined datalist of options for an input element. Read more on MDN

max
string

Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. Read more on MDN

maxLength
int

Sets or retrieves the maximum number of characters that the user can enter in a text control. Read more on MDN

min
string

Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. Read more on MDN

minLength
int
multiple
bool

Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. Read more on MDN

name
string

Sets or retrieves the name of the object. Read more on MDN

pattern
string

Gets or sets a string containing a regular expression that the user's input must match. Read more on MDN

placeholder
string

Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. Read more on MDN

readOnly
bool
required
bool

When present, marks an element that can't be submitted without a value. Read more on MDN

src
string

The address or WebApiURL of the a media resource that is to be considered. Read more on MDN

step
string

Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. Read more on MDN

type_
string

Returns the content type of the object. Read more on MDN

defaultValue
string

Sets or retrieves the initial contents of the object. Read more on MDN

value
string

Returns the value of the data at the cursor's current position. Read more on MDN

valueAsDate
Null.t<Date.t>

Returns a Date object representing the form control's value, if applicable; otherwise, returns null. Can be set, to change the value. Throws an "InvalidStateError" DOMException if the control isn't date- or time-based. Read more on MDN

valueAsNumber
float

Returns the input field value as a number. Read more on MDN

width
int

Sets or retrieves the width of the object. Read more on MDN

willValidate
bool

Returns whether an element will successfully validate based on forms validation rules and constraints. Read more on MDN

validity

Returns a ValidityState object that represents the validity states of an element. Read more on MDN

validationMessage
string

Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. Read more on MDN

selectionStart
Null.t<int>

Gets or sets the starting position or offset of a text selection. Read more on MDN

selectionEnd
Null.t<int>

Gets or sets the end position or offset of a text selection. Read more on MDN

selectionDirection
Null.t<string>
webkitdirectory
bool
capture
string
popoverTargetElement
popoverTargetAction
string

Values

addEventListener

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN

let addEventListener: (
t,
WebAPI.EventType.t,
WebAPI.DOM.EventListener.t<'event>,
~options: WebAPI.DOM.EventListener.addEventListenerOptions=?,
) => unit

Parameters

tWebAPI.EventType.tWebAPI.DOM.EventListener.toption<WebAPI.DOM.EventListener.addEventListenerOptions>

Return type

unit

addEventListenerWithCapture

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN

let addEventListenerWithCapture: (
t,
WebAPI.EventType.t,
WebAPI.DOM.EventListener.t<'event>,
) => unit

Parameters

tWebAPI.EventType.tWebAPI.DOM.EventListener.t

Return type

unit

after

Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let after: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

after2

Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let after2: (t, string) => unit

Parameters

tstring

Return type

unit

animate

let animate: (
t,
~keyframes: unknown,
~options: float=?,
) => WebAPI.Animation.t

Parameters

tunknownoption<float>

Return type

WebAPI.Animation.t

animate2

let animate2: (
t,
~keyframes: unknown,
~options: WebAPI.Animation.keyframeAnimationOptions=?,
) => WebAPI.Animation.t

append

Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let append: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

append2

Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let append2: (t, string) => unit

Parameters

tstring

Return type

unit

appendChild

let appendChild: (t, 't) => 't

asElement

let asElement: t => WebAPI.DOMTree.element

Parameters

t

Return type

WebAPI.DOMTree.element

asEventTarget

let asEventTarget: t => WebAPI.DOM.eventTarget

Parameters

t

Return type

WebAPI.DOM.eventTarget

asHTMLElement

let asHTMLElement: t => WebAPI.DOMTree.htmlElement

Parameters

t

Return type

WebAPI.DOMTree.htmlElement

asNode

let asNode: t => WebAPI.DOMTree.node

Parameters

t

Return type

WebAPI.DOMTree.node

attachInternals

let attachInternals: t => WebAPI.DOMTree.elementInternals

attachShadow

Creates a shadow root for element and returns it. Read more on MDN

let attachShadow: (t, WebAPI.HTML.shadowRootInit) => WebAPI.DOMTree.shadowRoot

before

Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let before: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

before2

Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let before2: (t, string) => unit

Parameters

tstring

Return type

unit

blur

let blur: t => unit

Parameters

t

Return type

unit

checkValidity

Returns whether a form will validate when it is submitted, without having to submit it. Read more on MDN

let checkValidity: t => bool

Parameters

t

Return type

bool

checkVisibility

let checkVisibility: (t, ~options: WebAPI.DOM.checkVisibilityOptions=?) => bool

Parameters

toption<WebAPI.DOM.checkVisibilityOptions>

Return type

bool

click

let click: t => unit

Parameters

t

Return type

unit

cloneNode

Returns a copy of node. If deep is true, the copy also includes the node's descendants. Read more on MDN

let cloneNode: (t, ~deep: bool=?) => t

Parameters

toption<bool>

Return type

t

closest

Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. Read more on MDN

let closest: (t, string) => Null.t<'e>

Parameters

tstring

Return type

Stdlib.Null.t

compareDocumentPosition

Returns a bitmask indicating the position of other relative to node. Read more on MDN

let compareDocumentPosition: (t, WebAPI.DOMTree.node) => int

Parameters

tWebAPI.DOMTree.node

Return type

int

computedStyleMap

let computedStyleMap: t => WebAPI.StylePropertyMapReadOnly.t

contains

Returns true if other is an inclusive descendant of node, and false otherwise. Read more on MDN

let contains: (t, WebAPI.DOMTree.node) => bool

Parameters

tWebAPI.DOMTree.node

Return type

bool

dispatchEvent

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. Read more on MDN

let dispatchEvent: (t, WebAPI.DOM.event) => bool

Parameters

tWebAPI.DOM.event

Return type

bool

focus

let focus: (t, ~options: WebAPI.DOM.focusOptions=?) => unit

Parameters

toption<WebAPI.DOM.focusOptions>

Return type

unit

getAnimations

let getAnimations: (
t,
~options: WebAPI.AnimationEffect.getAnimationsOptions=?,
) => array<WebAPI.Animation.t>

getAttribute

Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. Read more on MDN

let getAttribute: (t, string) => Null.t<string>

Parameters

tstring

Return type

Stdlib.Null.t<string>

getAttributeNames

Returns the qualified names of all element's attributes. Can contain duplicates. Read more on MDN

let getAttributeNames: t => array<string>

Parameters

t

Return type

array<string>

getAttributeNode

let getAttributeNode: (t, string) => Null.t<WebAPI.Attr.t>

Parameters

tstring

Return type

Stdlib.Null.t<WebAPI.Attr.t>

getAttributeNodeNS

let getAttributeNodeNS: (
t,
~namespace: string,
~localName: string,
) => Null.t<WebAPI.Attr.t>

Parameters

tstringstring

Return type

Stdlib.Null.t<WebAPI.Attr.t>

getAttributeNS

Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. Read more on MDN

let getAttributeNS: (
t,
~namespace: string,
~localName: string,
) => Null.t<string>

Parameters

tstringstring

Return type

Stdlib.Null.t<string>

getBoundingClientRect

let getBoundingClientRect: t => WebAPI.DOM.domRect

Parameters

t

Return type

WebAPI.DOM.domRect

getClientRects

let getClientRects: t => WebAPI.DOM.domRectList

Parameters

t

Return type

WebAPI.DOM.domRectList

getElementsByClassName

Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. Read more on MDN

let getElementsByClassName: (
t,
string,
) => WebAPI.HTMLCollection.t<WebAPI.DOMTree.element>

getElementsByTagName

let getElementsByTagName: (
t,
string,
) => WebAPI.HTMLCollection.t<WebAPI.DOMTree.element>

getElementsByTagNameNS

let getElementsByTagNameNS: (
WebAPI.DOMTree.element,
~namespace: string,
~localName: string,
) => WebAPI.HTMLCollection.t<WebAPI.DOMTree.element>

getHTML

let getHTML: (t, ~options: WebAPI.HTML.getHTMLOptions=?) => string

Parameters

toption<WebAPI.HTML.getHTMLOptions>

Return type

string

getRootNode

Returns node's root. Read more on MDN

let getRootNode: (t, ~options: getRootNodeOptions=?) => WebAPI.DOMTree.node

Parameters

toption<getRootNodeOptions>

Return type

WebAPI.DOMTree.node

hasAttribute

Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. Read more on MDN

let hasAttribute: (t, string) => bool

Parameters

tstring

Return type

bool

hasAttributeNS

Returns true if element has an attribute whose namespace is namespace and local name is localName. Read more on MDN

let hasAttributeNS: (t, ~namespace: string, ~localName: string) => bool

Parameters

tstringstring

Return type

bool

hasAttributes

Returns true if element has attributes, and false otherwise. Read more on MDN

let hasAttributes: t => bool

Parameters

t

Return type

bool

hasChildNodes

Returns whether node has children. Read more on MDN

let hasChildNodes: t => bool

Parameters

t

Return type

bool

hasPointerCapture

let hasPointerCapture: (t, int) => bool

Parameters

tint

Return type

bool

hidden

Returns the element's current hidden state.

let description = switch element->HTMLElement.hidden {
| HTMLElement.Visible => "visible"
| HTMLElement.Hidden => "hidden"
| HTMLElement.HiddenUntilFound => "hidden until found"
}

This getter never returns null.

Read more on MDN

let hidden: t => \"HTMLElement-WebAPI".hiddenState

Parameters

t

Return type

HTMLElement-WebAPI.hiddenState

hidePopover

let hidePopover: t => unit

Parameters

t

Return type

unit

insertAdjacentElement

let insertAdjacentElement: (
t,
~where: WebAPI.DOM.insertPosition,
~element: WebAPI.DOMTree.element,
) => Null.t<WebAPI.DOMTree.element>

insertAdjacentHTML

let insertAdjacentHTML: (
t,
~position: WebAPI.DOM.insertPosition,
~string: string,
) => unit

Parameters

tWebAPI.DOM.insertPositionstring

Return type

unit

insertAdjacentText

let insertAdjacentText: (
t,
~where: WebAPI.DOM.insertPosition,
~data: string,
) => unit

Parameters

tWebAPI.DOM.insertPositionstring

Return type

unit

insertBefore

let insertBefore: (t, 't, ~child: WebAPI.DOMTree.node) => 't

Parameters

t

Return type

WebAPI.DOMTree.node

isDefaultNamespace

let isDefaultNamespace: (t, string) => bool

Parameters

tstring

Return type

bool

isEqualNode

Returns whether node and otherNode have the same properties. Read more on MDN

let isEqualNode: (t, WebAPI.DOMTree.node) => bool

Parameters

tWebAPI.DOMTree.node

Return type

bool

isSameNode

let isSameNode: (t, WebAPI.DOMTree.node) => bool

Parameters

tWebAPI.DOMTree.node

Return type

bool

lookupNamespaceURI

let lookupNamespaceURI: (t, string) => Null.t<string>

Parameters

tstring

Return type

Stdlib.Null.t<string>

lookupPrefix

let lookupPrefix: (t, string) => Null.t<string>

Parameters

tstring

Return type

Stdlib.Null.t<string>

matches

Returns true if matching selectors against element's root yields element, and false otherwise. Read more on MDN

let matches: (t, string) => bool

Parameters

tstring

Return type

bool

normalize

Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. Read more on MDN

let normalize: t => unit

Parameters

t

Return type

unit

prepend

Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let prepend: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

prepend2

Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let prepend2: (t, string) => unit

Parameters

tstring

Return type

unit

querySelector

Returns the first element that is a descendant of node that matches selectors. Read more on MDN

let querySelector: (t, string) => Null.t<WebAPI.DOMTree.element>

Parameters

tstring

Return type

Stdlib.Null.t<WebAPI.DOMTree.element>

querySelectorAll

Returns all element descendants of node that match selectors. Read more on MDN

let querySelectorAll: (t, string) => WebAPI.DOM.nodeList<WebAPI.DOMTree.element>

Parameters

tstring

Return type

WebAPI.DOM.nodeList<WebAPI.DOMTree.element>

releasePointerCapture

let releasePointerCapture: (t, int) => unit

Parameters

tint

Return type

unit

remove

Removes node. Read more on MDN

let remove: t => unit

Parameters

t

Return type

unit

removeAttribute

Removes element's first attribute whose qualified name is qualifiedName. Read more on MDN

let removeAttribute: (t, string) => unit

Parameters

tstring

Return type

unit

removeAttributeNode

let removeAttributeNode: (t, WebAPI.Attr.t) => WebAPI.Attr.t

Parameters

tWebAPI.Attr.t

Return type

WebAPI.Attr.t

removeAttributeNS

Removes element's attribute whose namespace is namespace and local name is localName. Read more on MDN

let removeAttributeNS: (t, ~namespace: string, ~localName: string) => unit

Parameters

tstringstring

Return type

unit

removeChild

let removeChild: (t, 't) => 't

removeEventListener

Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN

let removeEventListener: (
t,
WebAPI.EventType.t,
WebAPI.DOM.EventListener.t<'event>,
~options: WebAPI.DOM.EventListener.options=?,
) => unit

Parameters

tWebAPI.EventType.tWebAPI.DOM.EventListener.toption<WebAPI.DOM.EventListener.options>

Return type

unit

removeEventListenerUseCapture

Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN

let removeEventListenerUseCapture: (
t,
WebAPI.EventType.t,
WebAPI.DOM.EventListener.t<'event>,
) => unit

Parameters

tWebAPI.EventType.tWebAPI.DOM.EventListener.t

Return type

unit

replaceChild

let replaceChild: (t, ~node: WebAPI.DOMTree.node, 't) => 't

Parameters

t

Return type

WebAPI.DOMTree.node

replaceChildren

Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let replaceChildren: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

replaceChildren2

Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let replaceChildren2: (t, string) => unit

Parameters

tstring

Return type

unit

replaceWith

Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let replaceWith: (t, WebAPI.DOMTree.node) => unit

Parameters

tWebAPI.DOMTree.node

Return type

unit

replaceWith2

Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.

Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. Read more on MDN

let replaceWith2: (t, string) => unit

Parameters

tstring

Return type

unit

reportValidity

let reportValidity: t => bool

Parameters

t

Return type

bool

requestFullscreen

Displays element fullscreen and resolves promise when done.

When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. Read more on MDN

let requestFullscreen: (
t,
~options: WebAPI.DOM.fullscreenOptions=?,
) => promise<unit>

Parameters

toption<WebAPI.DOM.fullscreenOptions>

Return type

promise<unit>

requestPointerLock

let requestPointerLock: (
t,
~options: WebAPI.DOM.pointerLockOptions=?,
) => promise<unit>

Parameters

toption<WebAPI.DOM.pointerLockOptions>

Return type

promise<unit>

scroll

let scroll: (t, ~options: WebAPI.DOM.scrollToOptions=?) => unit

Parameters

toption<WebAPI.DOM.scrollToOptions>

Return type

unit

scroll2

let scroll2: (t, ~x: float, ~y: float) => unit

Parameters

tfloatfloat

Return type

unit

scrollBy

let scrollBy: (t, ~options: WebAPI.DOM.scrollToOptions=?) => unit

Parameters

toption<WebAPI.DOM.scrollToOptions>

Return type

unit

scrollBy2

let scrollBy2: (t, ~x: float, ~y: float) => unit

Parameters

tfloatfloat

Return type

unit

scrollIntoView

scrollIntoView()

Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.

element->Element.scrollIntoView()

Read more on MDN

let scrollIntoView: t => unit

Parameters

t

Return type

unit

scrollIntoViewAlignToTop

scrollIntoView(true)

Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.

element->Element.scrollIntoView_alignToTop()

Read more on MDN

let scrollIntoViewAlignToTop: t => unit

Parameters

t

Return type

unit

scrollIntoViewWithOptions

scrollIntoView({ behavior: "smooth" })

Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.

element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth })

Read more on MDN

let scrollIntoViewWithOptions: (t, WebAPI.DOM.scrollIntoViewOptions) => unit

Parameters

tWebAPI.DOM.scrollIntoViewOptions

Return type

unit

scrollTo

let scrollTo: (t, ~options: WebAPI.DOM.scrollToOptions=?) => unit

Parameters

toption<WebAPI.DOM.scrollToOptions>

Return type

unit

scrollTo2

let scrollTo2: (t, ~x: float, ~y: float) => unit

Parameters

tfloatfloat

Return type

unit

select

Makes the selection equal to the current object. Read more on MDN

let select: t => unit

Parameters

t

Return type

unit

setAttribute

Sets the value of element's first attribute whose qualified name is qualifiedName to value. Read more on MDN

let setAttribute: (t, ~qualifiedName: string, ~value: string) => unit

Parameters

tstringstring

Return type

unit

setAttributeNode

let setAttributeNode: (t, WebAPI.Attr.t) => Null.t<WebAPI.Attr.t>

Parameters

tWebAPI.Attr.t

Return type

Stdlib.Null.t<WebAPI.Attr.t>

setAttributeNodeNS

let setAttributeNodeNS: (t, WebAPI.Attr.t) => Null.t<WebAPI.Attr.t>

Parameters

tWebAPI.Attr.t

Return type

Stdlib.Null.t<WebAPI.Attr.t>

setAttributeNS

Sets the value of element's attribute whose namespace is namespace and local name is localName to value. Read more on MDN

let setAttributeNS: (
t,
~namespace: string,
~qualifiedName: string,
~value: string,
) => unit

Parameters

tstringstringstring

Return type

unit

setCustomValidity

Sets a custom error message that is displayed when a form is submitted. @param error Sets a custom error message that is displayed when a form is submitted. Read more on MDN

let setCustomValidity: (t, string) => unit

Parameters

tstring

Return type

unit

setHidden

Sets the element's semantic hidden state.

element->HTMLElement.setHidden(HTMLElement.Hidden)
element->HTMLElement.setHidden(HTMLElement.HiddenUntilFound)
element->HTMLElement.setHidden(HTMLElement.Visible)

The browser also accepts values such as numbers, arbitrary strings, null, and undefined, but coerces each of them to one of these three states. This binding intentionally accepts only hiddenState so callers express the resulting state rather than relying on coercion.

Read more on MDN

let setHidden: (t, \"HTMLElement-WebAPI".hiddenState) => unit

Parameters

tHTMLElement-WebAPI.hiddenState

Return type

unit

setHTMLUnsafe

let setHTMLUnsafe: (t, string) => unit

Parameters

tstring

Return type

unit

setPointerCapture

let setPointerCapture: (t, int) => unit

Parameters

tint

Return type

unit

setRangeText

let setRangeText: (t, string) => unit

Parameters

tstring

Return type

unit

setRangeText2

let setRangeText2: (
t,
~replacement: string,
~start: int,
~end: int,
~selectionMode: WebAPI.DOM.selectionMode=?,
) => unit

Parameters

tstringintintoption<WebAPI.DOM.selectionMode>

Return type

unit

setSelectionRange

Sets the start and end positions of a selection in a text field. @param start The offset into the text field for the start of the selection. @param end The offset into the text field for the end of the selection. @param direction The direction in which the selection is performed. Read more on MDN

let setSelectionRange: (t, ~start: int, ~end: int, ~direction: string=?) => unit

Parameters

tintintoption<string>

Return type

unit

showPicker

let showPicker: t => unit

Parameters

t

Return type

unit

showPopover

let showPopover: t => unit

Parameters

t

Return type

unit

stepDown

Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. @param n Value to decrement the value by. Read more on MDN

let stepDown: (t, ~n: int=?) => unit

Parameters

toption<int>

Return type

unit

stepUp

Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. @param n Value to increment the value by. Read more on MDN

let stepUp: (t, ~n: int=?) => unit

Parameters

toption<int>

Return type

unit

toggleAttribute

If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

Returns true if qualifiedName is now present, and false otherwise. Read more on MDN

let toggleAttribute: (t, ~qualifiedName: string, ~force: bool=?) => bool

Parameters

tstringoption<bool>

Return type

bool

togglePopover

let togglePopover: (t, ~force: bool=?) => bool

Parameters

toption<bool>

Return type

bool