• Removes the attribute name 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.

    • name: AttributeName<TN>

      Name of the attribute to remove.

    Returns ElementOf<TN>

    Element representation of the specified target.

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

    HTML (Before)

    <button id="example" aria-disabled="true">
    Example
    </button>

    Code

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

    element = removeAttribute(element, "aria-disabled");

    HTML (After)

    <button id="example">
    Example
    </button>