class

JustHTML::Element

Inherits JustHTML::Node < Reference < Object

Constructors

new(name : String, namespace : String = "html")
Source
new(name : String, attrs, namespace : String = "html")
Source

Instance methods

[](attr : String) : String | Nil
Source
[]=(attr : String, value : String | Nil) : String | Nil
Source
ancestors

Returns a list of ancestor elements, from parent to root

Source
attrs
Source
attrs=(attrs : Hash(String, String | Nil))
Source
classes
Source
clone(deep : Bool = false) : Element
Source
has_attribute?(attr : String) : Bool
Source
has_class?(name : String) : Bool
Source
inner_html

Returns the HTML content of this element's children

Source
name
Source
namespace
Source
next_element_sibling

Returns the next sibling element, skipping text and comment nodes

Source
outer_html

Returns the HTML of this element including itself

Source
previous_element_sibling

Returns the previous sibling element, skipping text and comment nodes

Source
query_selector(selector_string : String) : Element | Nil

Query for the first matching element using CSS selector

Source
query_selector_all(selector_string : String) : Array(Element)

Query for all matching elements using CSS selector

Source
template_contents
Source
template_contents=(template_contents : DocumentFragment | Nil)
Source
text_content

Returns the text content of this element and its descendants

Source