func addClass(String) throws -> Element
Add a class name to this element’s {@code class} attribute.
func after(String) throws -> Element
Insert the specified HTML into the DOM after this element (as a following sibling).
func after(Node) throws -> Element
Insert the specified node into the DOM after this node (as a following sibling).
func append(String) throws -> Element
Add inner HTML to this element. The supplied HTML will be parsed, and each node appended to the end of the children.
func appendChild(Node) throws -> Element
Add a node child node to this element.
func appendElement(String) throws -> Element
Create a new element by tag name, and add it as the last child.
func appendText(String) throws -> Element
Create and append a new TextNode to this element.
func attr(String, String) throws -> Element
Set an attribute value on this element. If this element already has an attribute with the key, its value is updated; otherwise, a new attribute is added.
func attr([UInt8], [UInt8]) throws -> Element
Set an attribute value on this element. If this element already has an attribute with the key, its value is updated; otherwise, a new attribute is added.
func attr([UInt8], Bool) throws -> Element
Set a boolean attribute value on this element. Setting to true
sets the attribute value to “” and marks the attribute as boolean so no value is written out. Setting to false
removes the attribute with the same key if it exists.
func before(String) throws -> Element
Insert the specified HTML into the DOM before this element (as a preceding sibling).
func before(Node) throws -> Element
Insert the specified node into the DOM before this node (as a preceding sibling).
func child(Int) -> Element
Get a child element of this element, by its 0-based index number.
func children() -> Elements
Get this element’s child elements.
func className() throws -> String
Gets the literal value of this element’s “class” attribute, which may include multiple class names, space separated. (E.g. on <div class=“header gray”>
returns, “header gray
”)
func classNameUTF8() throws -> [UInt8]
Gets the literal value of this element’s “class” attribute, which may include multiple class names, space separated. (E.g. on <div class=“header gray”>
returns, “header gray
”)
func classNames() throws -> OrderedSet<String>
Get all of the element’s class names. E.g. on element {@code