Module

DOM.Simple

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

Re-exports from DOM.Simple.Document

#document Source

document :: Document

The global document. Will be undefined on node.

#createTextNode Source

#createElement' Source

createElement' :: Document -> String -> Element

Creates a new DOM element of the given tag using the provided document

#createElement Source

createElement :: String -> Element

Creates a new DOM element of the given tag using the global document

Re-exports from DOM.Simple.Element

#Callback Source

newtype Callback a

#setAttr Source

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

#replaceWith Source

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

Replace the current node with some others

#removeEventListener Source

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

#remove Source

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

Unhook the current node from its 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)

#prevElement Source

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

Returns the previous Element sibling if any

#prepend Source

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

#nextElement Source

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

Returns the next Element sibling if any

#lastChildElement Source

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

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

#innerHTML Source

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

#hasAttr Source

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

Checks whether an Element has a given attribute

#firstChildElement Source

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

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

#dispatchEvent Source

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

#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

#callback Source

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

#boundingRect Source

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

#before Source

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

Prepend some elements before the current node

#attrNames Source

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

Gets the names of the attributes the element possesses

#attr Source

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

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

#append Source

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

#after Source

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

Append some elements after the current node

#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.Types

#DOMRect Source

type DOMRect = { bottom :: Number, height :: Number, left :: Number, right :: Number, top :: Number, width :: Number, x :: Number, y :: Number }

#IsChild Source

class IsChild :: forall k. k -> Constraintclass (IsNode n) <= IsChild n 

A child node may occur within a parent

Instances

#IsElement Source

class IsElement :: forall k. k -> Constraintclass (IsNode n) <= IsElement n 

Instances

#IsParent Source

class IsParent :: forall k. k -> Constraintclass (IsNode n) <= IsParent n 

Parent nodes may contain children

Instances

#IsSibling Source

class IsSibling :: forall k. k -> Constraintclass (IsNode n) <= IsSibling n 

A Node which can have siblings (i.e. elements and cdata)

Instances

Re-exports from DOM.Simple.Window

#global Source

global :: forall a. String -> Maybe a