ValidityState.badInput

The read-only property ValidityState.badInput indicates if the user has provided input that the browser is unable to convert. For example, if you have a mail input element whose content does not have a '@'.

ExampleEdit

<input type="mail" id="email">
var input = document.getElementById("email");
if (input.validity.badInput) {
  console.log("Bad input detected…");
} else {
  console.log("Content of input ok.");
}

SpecificationsEdit

Specification Status Comment
WHATWG HTML Living Standard
The definition of 'ValidityState.badInput' in that specification.
Living Standard Live Standard
HTML5.1
The definition of 'ValidityState.badInput' in that specification.
Working Draft No change from the previous snapshot HTML5.
HTML5
The definition of 'ValidityState.badInput' in that specification.
Recommendation First snapshot of  WHATWG HTML Living Standard containing this interface.

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 29 (29) ? ? ?

See alsoEdit

Document Tags and Contributors

 Contributors to this page: cvrebert, Jeremie, teoli
 Last updated by: cvrebert,