Name
Form.elements[]: the input elements of a form — DOM Level 2 HTML
Synopsis
readonly HTMLCollection elements
Description
elements[] is an array-like
HTMLCollection of the form elements (such as Input, Select, and
Textarea objects) that appear in an HTML form. The elements of the
array are in the same order they appear in the HTML source code for
the form. Each element has a type
property whose string value identifies its type.
Usage
If an item in the elements[] array has been given a name
with the name="
name "
attribute of its HTML <input> tag, that item’s name
becomes a property of form, and this
property refers to the item. Thus, it is possible to refer to input
elements by name instead of by number:
form.nameSee Also
Input, HTMLCollection, Select, Textarea
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access