valid
Summary
Returns whether the input field value has any validity errors.
Property of dom/ValidityStatedom/ValidityState
Syntax
Note: This property is read-only.
var result = element.validity.valid;
Return Value
Returns an object of type BooleanBoolean
Whether a value has no validity errors.
Notes
The following example displays all validation states for a validated field. Note For code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.
Related specifications
- W3C HTML5
- Working Draft
- WHATWG HTML
- Living Standard
Attributions
Microsoft Developer Network: [valid Property Article]
Portions of this content come from HTML5Rocks! [Making forms fabulous article]