This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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