Function createNodeWith

  • Create a new node.

    Type Parameters

    • K extends keyof HTMLElementTagNameMap

    Parameters

    • tag: K

      the tag name of the node

    • options: {
          attributes?: {
              [keyof: string]: string;
          };
          innerHTML?: string;
          textContent?: string;
      } = {}

      optional parameters

      • Optional attributes?: {
            [keyof: string]: string;
        }

        attributes of the node

        • [keyof: string]: string
      • Optional innerHTML?: string

        the HTML code of the node

      • Optional textContent?: string

        the text content of the node

    Returns HTMLElementTagNameMap[K]

    the created node

Generated using TypeDoc