Module

DOM.Simple.Element

Package
purescript-dom-simple
Repository
garganscript/purescript-dom-simple

#hasAttr Source

hasAttr :: forall e. IsElement e => e -> String -> Boolean

Checks whether an Element has a given attribute

#attr Source

attr :: forall e. IsElement e => e -> String -> Maybe String

Gets the value of an attribute, if the element has it

#attrNames Source

attrNames :: forall e. IsElement e => e -> Array String

Gets the names of the attributes the element possesses

#setAttr Source

setAttr :: forall e. IsElement e => e -> String -> String -> Effect Unit

#innerHTML Source

innerHTML :: forall e. IsElement e => e -> String

#boundingRect Source

boundingRect :: forall e. IsElement e => e -> DOMRect

Re-exports from DOM.Simple.Child

#replaceWith Source

replaceWith :: forall n. IsChild n => n -> Array Element -> Effect Unit

Replace the current node with some others

#remove Source

remove :: forall n. IsChild n => n -> Effect Unit

Unhook the current node from its parent

#before Source

before :: forall n. IsChild n => n -> Array Element -> Effect Unit

Prepend some elements before the current node

#after Source

after :: forall n. IsChild n => n -> Array Element -> Effect Unit

Append some elements after the current node

Re-exports from DOM.Simple.EventListener

#Callback Source

newtype Callback a

#removeEventListener Source

removeEventListener :: forall listener event. IsEventListener listener => IsEvent event => listener -> String -> Callback event -> Effect Unit

#dispatchEvent Source

dispatchEvent :: forall l e. IsEventListener l => l -> e -> Effect Unit

#callback Source

callback :: forall a. (a -> Effect Unit) -> Callback a

#addEventListener Source

addEventListener :: forall listener event. IsEventListener listener => IsEvent event => listener -> String -> Callback event -> Effect Unit

A little unsafe

Re-exports from DOM.Simple.Node

#textContent Source

textContent :: forall n. IsNode n => n -> String

#prevSibling Source

prevSibling :: forall n m. IsNode n => IsNode m => n -> m

Gets the previous sibling

#parentNode Source

parentNode :: forall n m. IsNode n => IsNode m => n -> m

#parentElement Source

parentElement :: forall n. IsNode n => n -> Maybe Element

#ownerDocument Source

ownerDocument :: forall n m. IsNode n => IsNode m => n -> Document

#nextSibling Source

nextSibling :: forall n m. IsNode n => IsNode m => n -> m

Gets the next sibling

#name Source

name :: forall n. IsNode n => n -> String

#contains Source

contains :: forall n. IsNode n => n -> n -> Boolean

Re-exports from DOM.Simple.Parent

#querySelectorAll Source

querySelectorAll :: forall n. IsParent n => n -> String -> Effect (Array Element)

#querySelector Source

querySelector :: forall n. IsParent n => n -> String -> Effect (Maybe Element)

#prepend Source

prepend :: forall n. IsParent n => n -> Array Element -> Effect Unit

#lastChildElement Source

lastChildElement :: forall n. IsParent n => n -> Maybe Element

Find the last Element that is a child of the current Node, if any

#firstChildElement Source

firstChildElement :: forall n. IsParent n => n -> Maybe Element

Find the first Element that is a child of the current Node, if any

#children Source

children :: forall n. IsParent n => n -> Array Element

Returns an array of the child Elements

#childCount Source

childCount :: forall n. IsParent n => n -> Int

Returns the number of child Elements

#append Source

append :: forall n. IsParent n => n -> Array Element -> Effect Unit

Re-exports from DOM.Simple.Sibling

#prevElement Source

prevElement :: forall e. IsSibling e => e -> Maybe Element

Returns the previous Element sibling if any

#nextElement Source

nextElement :: forall e. IsSibling e => e -> Maybe Element

Returns the next Element sibling if any