DOM Form Object
The Form object represents an HTML form.
For each <form>
tag in an HTML document, a Form object is created.
Collections
Collection | Description |
---|---|
elements[] |
Returns an array of all elements in a form |
Properties
Property | Description |
---|---|
acceptCharset |
Sets or returns the value of the accept-charset attribute in a form |
action |
Sets or returns the value of the action attribute in a form |
enctype |
Sets or returns the value of the enctype attribute in a form |
length |
Returns the number of elements in a form |
method |
Sets or returns the value of the method attribute in a form |
name |
Sets or returns the value of the name attribute in a form |
target |
Sets or returns the value of the target attribute in a form |
Methods
Method | Description |
---|---|
reset() |
Resets a form |
submit() |
Submits a form |
Events
Event | The event occurs when... |
---|---|
onreset |
The reset button is clicked |
onsubmit |
The submit button is clicked |
Standard Properties and Methods
This object also supports the standard properties and methods.
Standard Events
This object also supports the standard events.