GeoLeaf Core API - v3.0.0
    Preparing search index...
    • DOM element creation helper — the canonical factory (ADR-10).

      Creates a DOM element, optionally sets its className, and optionally appends it to a parent.

      Type Parameters

      • K extends keyof HTMLElementTagNameMap

      Parameters

      • tag: K

        HTML tag name (e.g. "div", "span", "button").

      • OptionalclassName: string

        CSS class(es) to set on the element. Optional.

      • Optionalparent: HTMLElement

        Parent element to append to. Optional.

      Returns HTMLElementTagNameMap[K]

      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).

      ADR-10 in _docs_projet/travail/cdc/CDC_technique.md for the migration pitfalls between the two factories.

    • DOM element creation helper — the canonical factory (ADR-10).

      Creates a DOM element, optionally sets its className, and optionally appends it to a parent.

      Parameters

      • tag: string

        HTML tag name (e.g. "div", "span", "button").

      • OptionalclassName: string

        CSS class(es) to set on the element. Optional.

      • Optionalparent: HTMLElement

        Parent element to append to. Optional.

      Returns HTMLElement

      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).

      ADR-10 in _docs_projet/travail/cdc/CDC_technique.md for the migration pitfalls between the two factories.