eeue56/elm-html-query/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

ElmHtml.Query

Query things using ElmHtml

query : Selector -> ElmHtml -> List ElmHtml

Query a Html element using a selector

queryAll : List Selector -> ElmHtml -> List ElmHtml

Query to ensure a html node has all selectors given

queryInNode : Selector -> ElmHtml -> List ElmHtml

Query a Html node using a selector

= Id String
| ClassName String
| ClassList (List String)
| Tag String
| Attribute String String
| BoolAttribute String Bool
| ContainsText String
| Multiple (List Selector)

Selectors to query a Html element

  • Id, classname, classlist, tag are all what you'd expect
  • Attribute and bool attribute are attributes
  • ConainsText just searches inside for the given text
queryById : String -> ElmHtml -> List ElmHtml

Query for a node with a given id in a Html element

queryByClassName : String -> ElmHtml -> List ElmHtml

Query for a node with a given classname in a Html element

queryByClassList : List String -> ElmHtml -> List ElmHtml

Query for a node with all the given classnames in a Html element

queryByTagName : String -> ElmHtml -> List ElmHtml

Query for a node with a given tag in a Html element

queryByAttribute : String -> String -> ElmHtml -> List ElmHtml

Query for a node with a given attribute in a Html element

queryByBoolAttribute : String -> Bool -> ElmHtml -> List ElmHtml

Query for a node with a given attribute in a Html element