First name:
Last"> First name:
Last" />
Easy Tutorial
❮ Home Av Event Abort ❯

HTML <form> method Attribute

HTML <form> Tag

Example

Submit a form using the "get" method:

<form action="demo_form.html" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

Browser Support

All major browsers support the method attribute.


Definition and Usage

The method attribute specifies how to send form-data (form-data is sent to the page specified in the action attribute).

The form-data can be sent as URL variables (with method="get") or as an HTTP post transaction (with method="post").

Notes on GET:

Notes on POST:


Differences Between HTML 4.01 and HTML5

None.


Syntax

Attribute Values

Value Description
get Default. Appends form-data to the URL: URL?name=value&name=value.
post Sends form-data as an HTTP post transaction.

More Examples

Submit a form using the "post" method

❮ Home Av Event Abort ❯