• Removes the attributes with names from the target.

    Type Parameters

    • TN extends TagName = "*"

      Tag name of the Element representation of target.

    Parameters

    • target: null | Target<TN>

      Element, EventTarget, or CSS selector.

    • names: AttributeName<TN>[]

      Array of attribute names to remove.

    Returns ElementOf<TN>

    Element representation of the specified target.

    elements!InvalidElementError if the specified target wasn't found.

    HTML (Before)

    <div
    id="example"
    role="slider"
    aria-valuemax="30"
    aria-label="Example"
    aria-disabled="false"
    >
    ...
    </div>

    Code

    const element = findElement("#example")!;

    removeAttributes(element, [
    "role",
    "aria-valuemax",
    "aria-disabled",
    ]);

    HTML (After)

    <div
    id="example"
    aria-label="Example"
    >
    ...
    </div>