Skip to content

Attr

Types

t

A WebApiDOM element's attribute as an object. In most WebApiDOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. See Attr on MDN

type t = {
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>,
namespaceURI: Null.t<string>,
prefix: Null.t<string>,
localName: string,
name: string,
mutable value: string,
ownerElement: Null.t<WebAPI.DOMTree.element>,
}

Record fields

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>
namespaceURI
Null.t<string>
prefix
Null.t<string>
localName
string
value
string