eeue56/elm-html-query/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

ElmHtml.Query

Query things using ElmHtml

= 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
query : Selector -> ElmHtml -> List ElmHtml

Query an ElmHtml element using a selector, searching all children.

queryAll : List Selector -> ElmHtml -> List ElmHtml

Query an ElmHtml node using multiple selectors, considering both the node itself as well as all of its descendants.

queryChildren : Selector -> ElmHtml -> List ElmHtml

Query an ElmHtml node using a selector, considering both the node itself as well as all of its descendants.

queryChildrenAll : List Selector -> ElmHtml -> List ElmHtml

Query to ensure an ElmHtml node has all selectors given, without considering any descendants lower than its immediate children.

queryInNode : Selector -> ElmHtml -> List ElmHtml

Query an ElmHtml node using a selector, considering both the node itself as well as all of its descendants.

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