Expand description
DOM helper utilities.
Convenience functions for common DOM operations.
Structs§
- Document
- Document represents an HTML document to be manipulated.
Functions§
- add_
class - Add a class to the element.
- children
- Get direct element children.
- clone_
document - Clone a document.
- direct_
text - Get direct text of element (non-recursive, excludes nested element text).
- get_
all_ attributes - Get all attributes as key-value pairs.
- get_
attribute - Get attribute value.
- has_
attribute - Check if attribute exists.
- has_
class - Check if element has specified class.
- inner_
html - Get inner HTML content.
- is_
void_ element - Check if element is a void element (self-closing).
- matches
- Check if element matches a CSS selector.
- next_
element_ sibling - Get next element sibling (skipping text nodes).
- outer_
html - Get outer HTML content.
- parent
- Get parent element.
- parse
- Parse HTML string into Document.
- previous_
element_ sibling - Get previous element sibling (skipping text nodes).
- remove
- Remove element from DOM.
- remove_
attribute - Remove attribute.
- remove_
class - Remove a class from the element.
- rename
- Rename element tag.
- set_
attribute - Set attribute value.
- tag_
name - Get tag name (lowercase).
- text_
content - Get text content of element (recursive).