• Returns the value of the specified target with the specified type. The value is returned as a number if the valueAsNumber property returns a valid number, a Date if the valueAsDate property is a valid Date (not null), a boolean if the input is a checkbox or radio type, otherwise is returned as a string.

    Type Parameters

    • T

      Type of the value that gets returned.

    Parameters

    • target: null | Target

      Element, EventTarget, or CSS selector.

    Returns T

    Value of the specified target as type T.

    InvalidElementError if the specified target wasn't found.