Form method property
Form Object
Definition and Usage
The method property can set or return the value of the method attribute of the form.
The method property specifies how the form data is sent (the form data submission address is specified in the action attribute).
Syntax
formObject.method=
value
The method property can be one of the following values:
| Value | Description |
|---|---|
| get | Adds form data to the URL: URL?name=value&name=value (default) |
| post | Uses the HTTP POST method to submit the form data |
Browser support





All major browsers support the method property
Note: Internet Explorer returns "get" if the method attribute is not defined (default), while other browsers return no value.
Example
Example
Return the method used to send the form data:
The example above produces the following output:
get
Try it »
Form Object