eeue56/elm-html-query/2.0.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 msg -> List (ElmHtml msg)

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

queryAll : List Selector -> ElmHtml msg -> List (ElmHtml msg)

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

queryChildren : Selector -> ElmHtml msg -> List (ElmHtml msg)

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

queryChildrenAll : List Selector -> ElmHtml msg -> List (ElmHtml msg)

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

queryInNode : Selector -> ElmHtml msg -> List (ElmHtml msg)

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

queryById : String -> ElmHtml msg -> List (ElmHtml msg)

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

queryByClassName : String -> ElmHtml msg -> List (ElmHtml msg)

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

queryByClassList : List String -> ElmHtml msg -> List (ElmHtml msg)

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

queryByTagName : String -> ElmHtml msg -> List (ElmHtml msg)

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

queryByAttribute : String -> String -> ElmHtml msg -> List (ElmHtml msg)

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

queryByBoolAttribute : String -> Bool -> ElmHtml msg -> List (ElmHtml msg)

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

getChildren : ElmHtml msg -> List (ElmHtml msg)

Returns just the immediate children of an ElmHtml node