Function createElement

Creates an instance of the element for the specified tag.

  • Creates an instance of the element for the specified tag.

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • tagName: K

      The name of an element.

      MDN Reference

    • Optionaloptions: ElementCreationOptions

    Returns HTMLElementTagNameMap[K]

  • Type Parameters

    • K extends keyof HTMLElementDeprecatedTagNameMap

    Parameters

    • tagName: K
    • Optionaloptions: ElementCreationOptions

    Returns HTMLElementDeprecatedTagNameMap[K]

  • Parameters

    • tagName: string
    • Optionaloptions: ElementCreationOptions

    Returns HTMLElement