• Sets the style properties of the specified target to the specified styles object with key of style property name and value of the corresponding property value.

    Type Parameters

    • TN extends TagName = "*"

      Tag name of the Element representation of target.

    Parameters

    • target: null | Target

      Element, EventTarget, or CSS selector.

    • styles: Partial<Record<StyleKey, StyleValue>>

      Object with style property values keyed by name.

    Returns ElementOf<TN>

    Element representation of the specified target.

    elements!InvalidElementError if the target could not be found or doesn't have a style property.