Methods

Returns a Boolean that is true if the element's child controls are subject to constraint validation and satify those contraints, or false if some controls do not satisfy their constraints. Fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. It is up to the programmer to decide how to respond to false.

Gets the item in the elements collection at the specified index, or null if there is no item at that index. You can also specify the index in array-style brackets or parentheses after the form object name, without calling this method explicitly.

Gets the item or list of items in elements collection whose name or id match the specified name, or null if no items match. You can also specify the name in array-style brackets or parentheses after the form object name, without calling this method explicitly.

Returnstrue if the element's child controls satisfy their validation constraints. Whenfalse is returned, cancelableinvalid events are fired for each invalid child and validation problems are reported to the user.

Examples

The following example shows how to create a new form element, modify its attributes and submit it.

The elements properties returns an HTMLFormControlsCollection instead of a raw HTMLCollection. This is mainly a technical change.
The following method has been added: checkValidity().
The following properties have been added: autocomplete, noValidate, and encoding.