Type Alias CreateElementOptions<TN>

CreateElementOptions: Partial<
    Omit<ElementPropertiesOf<TN>, "attributes" | "dataset">,
> & {
    attributes?: Attributes<TN>;
    cssVars?: CssVars;
    dataset?: Dataset;
    on?: EventListenersOrDescriptorsFor;
    styles?: Styles;
}

Options for creating an element using createElement.

Type Parameters

  • TN extends TagName

    Tag name for the created element.

Type declaration

  • Optionalattributes?: Attributes<TN>

    Attributes to set on element.

  • OptionalcssVars?: CssVars

    CSS variables to set on element.

  • Optionaldataset?: Dataset

    Dataset entries to set on element.

  • Optionalon?: EventListenersOrDescriptorsFor

    Event listeners or EventDescriptorFor objects to set on element.

    The EventDescriptor is an object with a listener field that defines the callback that is fired when the corresponding event is dispatched and an options object matching the options argument in addEventListener. See the MDN documentation for additional details.

  • Optionalstyles?: Styles

    Styles to set on element.