This interface also inherits properties from its parent,
DOMStringrepresenting the default value of the element, initially the empty string.
DOMStringrepresenting a localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (
false), or it satisfies its constraints.
ValidityStaterepresenting the validity states that this element is in.
A boolean value indicating whether the element is a candidate for constraint validation.
This interface also inherits methods from its parent,
Checks the validity of the element and returns a boolean value holding the check result.
This method reports the problems with the constraints on the element, if any, to the user. If there are problems, fires an
invalidevent at the element, and returns
false; if there are no problems, it returns
When the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention. User agents may report more than one constraint violation if this element suffers from multiple problems at once. If the element is not rendered, then the user agent may report the error for the running script instead of notifying the user.
Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
This element behaves in one of two modes: default mode and value mode.
Initially, the element is in default mode, and so the contents of the element represent both the value of the element and its default value.
If the element is in default mode when the descendants of the element are changed in any way, the
defaultValue property is set to the value of the
Resetting the form puts the element into default mode, and sets the
textContent property to the value of the
The element goes into value mode when the contents of the
value property are set. The
value property otherwise behaves like the
textContent property. When the element is in value mode, the default value is accessible only through the
|HTML Standard (HTML)|
BCD tables only load in the browser
- The HTML element implementing this interface: