HTML and CSS Reference
Table B.1. Constraint Validation API
Checks if the element validates when the form is submitted.
Holds the error message the user will see if the element is checked for validity.
An object that contains attributes representing the validity states of the element.
Each attribute defines a validation error condition. When “getting” an attribute,
a value of true is returned if the error condition is true, otherwise false.
validity contains the following boolean attributes:
• valueMissing (required field but has no value)
• typeMismatch (incorrect data type)
• patternMismatch (doesn't match required pattern)
• tooLong (longer than maxlength content attribute value)
• rangeUnderflow (lower than min content attribute value)
• rangeOverflow (higher than max content attribute value)
• stepMismatch (not a multiple of step content attribute)
• customError (has a custom error)
• valid (field is valid)
Checks if the element is valid.
Sets a custom error message on the element.
B.1.2. API for offline web applications
The API for offline web applications consists of a collection of events and a number of
DOM attributes and methods. Table B.2 lists the events.
Table B.2. Application cache events
Fires when checking for an update or trying to download the cache manifest for the first
Fires when manifest has not been modified.
Fires when the browser is downloading items in the manifest for the first time. Also fires
when the browser is downloading items after detecting a manifest update.
Fires once per file as the browser downloads each file listed in the manifest. The event
object's total attribute returns the total number of files to be downloaded. The event ob-
ject's loaded attribute returns the number of files processed so far.
The application is cached and the download is complete.
Resources have been downloaded and an update is available. The application can use the
swapCache method to switch to the new resources.
The manifest was not found and the cache is being removed.