HTML tag name (e.g. "div", "span", "button").
OptionalclassName: stringCSS class(es) to set on the element. Optional.
Optionalparent: HTMLElementParent element to append to. Optional.
The newly created element, typed from tag.
Preferred over createElement for new code: it returns the precise
HTMLElementTagNameMap[K] type and takes a parent. Reach for
createElement only when you need its declarative props bag (dataset,
attributes, on* handlers, sanitized innerHTML).
DOM element creation helper — the canonical factory (ADR-10).
Creates a DOM element, optionally sets its className, and optionally appends it to a parent.
HTML tag name (e.g. "div", "span", "button").
OptionalclassName: stringCSS class(es) to set on the element. Optional.
Optionalparent: HTMLElementParent element to append to. Optional.
The newly created element, typed from tag.
Preferred over createElement for new code: it returns the precise
HTMLElementTagNameMap[K] type and takes a parent. Reach for
createElement only when you need its declarative props bag (dataset,
attributes, on* handlers, sanitized innerHTML).
DOM element creation helper — the canonical factory (ADR-10).
Creates a DOM element, optionally sets its className, and optionally appends it to a parent.