Creates a new HTML element.
The HTML tag name (e.g., 'div', 'span', 'h1')
Optionalchildren: TemplateItem[]Optional initial child elements
OptionalchildrenOptional initial child elements
CSS classes for this element. Dynamically managed through the CssClassValue interface.
Style attribute value. Can be a string or TemplateValue.
The HTML tag name (e.g., 'div', 'span', 'h1')
Fluent method that appends a child element or text to this element. If a string containing HTML is passed, it will be parsed into elements.
The child element or text to append
This element for method chaining
Fluent method that sets a single attribute on this element. Special handling: the 'class' attribute updates the class object directly.
Attribute name
Attribute value
This element for method chaining
Fluent method that sets all attributes from the given collection.
Key-value collection of attributes to set
This element for method chaining
Represents an HTML element in the template tree. Allows for dynamic attribute and class management, child element manipulation, and rendering to HTML strings.
TemplateElement
Example