Skip to content

nonbili/purescript-nonbili-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-nonbili-dom

GitHub release (latest by date) purescript-nonbili-dom on Pursuit CircleCI

Some helpful DOM functions.

-- | Copy a string to clipbard.
copyToClipboard :: String -> Effect Unit

-- | Fit <input> width to its content width without showing scrollbar.
fitInputWidth :: HTMLElement.HTMLElement -> Number -> Effect Unit

-- | Fit <textarea> height to content height without showing scrollbar.
fitTextareaHeight :: HTMLElement.HTMLElement -> Number -> Effect Unit

-- | Get inner HTML of an element.
innerHTML :: Element -> Effect String

-- | Set inner HTML of an element.
setInnerHTML :: Element -> String -> Effect Unit

-- | Get rendered text content of an element.
innerText :: HTMLElement -> Effect String

-- | Set rendered text content of an element.
setInnerText :: HTMLElement -> String -> Effect Unit