Platform Support
| Mozilla | Chrome | Safari | Opera | IE | Netscape | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|---|
Constructors
| Constructor | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLFormElement Constructor() : HTMLFormElement
Creates an instance of the HTMLFormElement.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | ||
HTMLFormElement() : HTMLFormElementCreates an instance of the HTMLFormElement. Returns
|
|||||||||
Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
acceptCharset
: String
Gives the character encodings that are to be used for the submission.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
action
: String
Specifies the action attribute of the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
autocomplete
: String
Specifies the autocomplete attribute of the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
enctype
: String
Specifies the encoded type of the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
method
: String
Specifies the method for the form (GET, POST, PUT, DELETE)
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
name
: String
Specifies the name of the form.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
noValidate
: Boolean
Specifies whether form is validated during submission.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
target
: String
Specifies the target for the form.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
elements
: HTMLFormControlsCollection
An HTMLFormControlsCollection rooted at the Document node, whose filter matches listed elements whose form owner is the form
element, with the exception of input elements whose type attribute is in the Image Button state.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
|
length
: Number
Specifies the number of nodes represented by the elements collection.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
Inherited Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the
Element nodes with the specified classNames. |
Show Details | 1.9+ | 5.0+ | 3.1+ | 9.51+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||
|---|---|---|---|---|---|---|---|---|---|---|
|
item(Number index) :
void
Returns the indexth element in the form.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
Parameters
|
||||||||||
|
namedItem(String name) :
void
Returns the form control in the form with the given ID or name.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
Parameters
|
||||||||||
|
submit() :
void
Submits the form element from the form element itself, with the scripted-submit flag set.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
||||||||||
|
reset() :
void
Resets the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
||||||||||
|
checkValidity() : Boolean
The user agent must instanceally validate the constraints of the form element, and return true if the constraint validation
return a positive result, and false if it returned a negative result.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
Returns
|
||||||||||
|
dispatchFormInput() :
void
When invoked, the user agent must broadcast forminput events from the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
||||||||||
|
dispatchFormChange() :
void
When invoked, the user agent must broadcast formchange events from the form element.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||
|
||||||||||
References
Availability
JavaScript 1.2|WhatWG