Baseline Widely available
The validity
read-only property of the HTMLInputElement
interface returns a ValidityState
object that represents the validity states this element is in.
A ValidityState
object.
The following example gets the validity state of an input element and processes it if it is not valid:
const input = document.getElementById("myInput");
const validityState = input.validity;
if (!validityState.valid) {
// Test each validity state
}
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3