Class TagClass

Represents the class attribute for an HTML tag.

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new TagClass instance.

    Parameters

    • Optional value: string | string[] | Set<string>

      The initial value of the class attribute.

    Returns TagClass

Properties

value: Set<string> = ...

The value of the class.

Accessors

  • get size(): number
  • Returns the number of class names in the class attribute.

    Returns number

    The number of class names in the class attribute.

Methods

  • Adds one or more class names to the class attribute.

    Parameters

    • Rest ...value: string[]

      One or more class names to add.

    Returns void

  • Removes all class names from the class attribute.

    Returns void

  • Checks whether the class attribute contains a class name.

    Parameters

    • value: string

      The class name to check.

    Returns boolean

    true if the class attribute contains the class name, otherwise false.

  • Removes one or more class names from the class attribute.

    Parameters

    • Rest ...value: string[]

      One or more class names to remove.

    Returns void

  • Returns a CSS selector string for the class attribute.

    Returns string

    A CSS selector string for the class attribute.

  • Returns a string representation of the class attribute.

    Returns string

    A string representation of the class attribute.

Generated using TypeDoc