Module

Web.DOM.Node

Package
purescript-web-dom
Repository
purescript-web/purescript-web-dom

#nodeType Source

nodeType :: Partial => Node -> NodeType

The type of a node.

#nodeTypeIndex Source

nodeTypeIndex :: Node -> Int

The numeric value for the type of a node.

#nodeName Source

nodeName :: Node -> String

For elements this is the tag name, for document types this is the doctype name, for processing instructions this is the target, for all other nodes it is a string like "#text", `"#comment", etc. depending on the node type.

#baseURI Source

baseURI :: Node -> Effect String

The node's base URL.

#ownerDocument Source

ownerDocument :: Node -> Effect (Maybe Document)

The document the node belongs to, unless the node is a document in which case the value is Nothing.

#parentNode Source

parentNode :: Node -> Effect (Maybe Node)

The parent node of the node.

#parentElement Source

parentElement :: Node -> Effect (Maybe Element)

The parent element of the node.

#hasChildNodes Source

hasChildNodes :: Node -> Effect Boolean

Indicates whether the node has any child nodes.

#childNodes Source

childNodes :: Node -> Effect NodeList

The children of the node.

#firstChild Source

firstChild :: Node -> Effect (Maybe Node)

The first child of the node, or Nothing if the node has no children.

#lastChild Source

lastChild :: Node -> Effect (Maybe Node)

The last child of the node, or Nothing if the node has no children.

#previousSibling Source

previousSibling :: Node -> Effect (Maybe Node)

The previous sibling node, or Nothing if there is no previous sibling.

#nextSibling Source

nextSibling :: Node -> Effect (Maybe Node)

The next sibling node, or Nothing if there is no next sibling.

#nodeValue Source

nodeValue :: Node -> Effect (Maybe String)

If the node type is text, comment, or processing instruction this is Just the node's data, or Nothing in all other cases.

#setNodeValue Source

setNodeValue :: String -> Node -> Effect Unit

If the node type is text, comment, or processing instruction this allows the node's data to be changed, or has no effect in all other cases.

#textContent Source

textContent :: Node -> Effect String

If the node type is document fragment, element, text, processing instruction, or comment this is the node's data, or null in all other cases.

#setTextContent Source

setTextContent :: String -> Node -> Effect Unit

If the node type is document fragment, element, text, processing instruction, or comment this allows the node's data to be changed, or has no effect in all other cases.

#normalize Source

normalize :: Node -> Effect Unit

Removes empty text nodes and then combines any remaining text nodes that are contiguous.

#clone Source

clone :: Node -> Effect Node

Clones the node without cloning the node's descendants.

#deepClone Source

deepClone :: Node -> Effect Node

Clones the node and its descendants.

#isEqualNode Source

isEqualNode :: Node -> Node -> Effect Boolean

Checks whether two nodes are equivalent.

#compareDocumentPositionBits Source

compareDocumentPositionBits :: Node -> Node -> Effect Int

Compares the position of two nodes in the document.

#contains Source

contains :: Node -> Node -> Effect Boolean

Checks whether the second node is contained within the first

#lookupNamespaceURI Source

#isDefaultNamespace Source

#insertBefore Source

insertBefore :: Node -> Node -> Node -> Effect Unit

Inserts the first node before the second as a child of the third node.

#appendChild Source

appendChild :: Node -> Node -> Effect Unit

Appends the first node to the child node list of the second node.

#replaceChild Source

replaceChild :: Node -> Node -> Node -> Effect Unit

Uses the first node as a replacement for the second node in the children of the third node.

#removeChild Source

removeChild :: Node -> Node -> Effect Unit

Removes the first node from the children of the second node.

Re-exports from Web.DOM.Internal.Types

#Node Source

data Node :: Type