Object: HTMLFormElement
The HTMLFormElement object represents a <form> element in an HTML document.
The <form> element specifies a form that gathers information from the user. Users can submit a form by using the <submit> input element. After a submission, the form collects the names and values of enclosed <select>, <input>, and <textarea> elements and submits the query as part of the request (GET) or as post data (POST).
HTMLFormElement properties
|
Property name |
Type |
Description |
Status |
Support level |
Availability |
|---|---|---|---|---|---|
|
DOMString |
Specifies a list of valid character sets for form data. |
writable |
DOM 2 HTML |
4.6 or later |
|
|
DOMString |
Specifies a URI to which the form is submitted. |
writable |
DOM 2 HTML |
4.6 or later |
|
|
Returns an index of the form control elements contained within the form. Index positions begin at 0 and continue to HTMLCollection.length-1. Image buttons (<input> elements for which type="image") are excluded from the collection. |
read only |
DOM 2 HTML |
4.6 or later |
||
|
DOMString |
Specifies the content type the form data is encoded with. |
writable |
DOM 2 HTML |
4.6 or later |
|
|
int |
Returns the number of form control elements contained within the form. |
read only |
DOM 2 HTML |
4.6 or later |
|
|
DOMString |
Specifies the HTTP method used to send the data to the server. |
writable |
DOM 2 HTML |
4.6 or later |
|
|
DOMString |
Specifies a unique name for the form. |
read only |
DOM 2 HTML |
4.6 or later |
|
|
DOMString |
Specifies where the target document is opened. |
writable |
DOM 2 HTML |
4.6 or later |