Function setAttr

Sets one or more attributes softly, i.e. does not make any changes if the attribute already has the probided value. Removes the attribute if the provided value is false or undefined or null. Sets the attribute to the empty string if the provided value is true.

  • Parameters

    • el: HTMLElement
    • name: Record<string,
          | undefined
          | null
          | string
          | number
          | boolean>

    Returns void

  • Parameters

    • el: HTMLElement
    • name: string
    • value:
          | undefined
          | null
          | string
          | number
          | boolean

    Returns void