The HTML <form> method Attribute is used to specify the HTTP method used to send data while submitting the form. There are two kinds of HTTP methods, which are GET and POST. The method attribute can be used with the <form> element.
- GET: In the GET method, after the submission of the form, the form values will be visible in the address bar of the new browser tab. It has a limited size of about 3000 characters. It is only useful for non-secure data not for sensitive information.
- POST: In the post method, after the submission of the form, the form values will not be visible in the address bar of the new browser tab as it was visible in the GET method. It appends form data inside the body of the HTTP request. It has no size limitation. This method does not support bookmark the result.
Example 1: This example illustrates the use of GET method attribute.
Example 2: This example illustrates the use of POST method attribute. This method sends the form-data as an HTTP post transaction.
Supported Browsers: The browser supported by HTML <form> method Attribute are listed below:
- Google Chrome
- Internet Explore
- Mozila Firefox
- HTML | <html> xmlns Attribute
- HTML | method Attribute
- HTML | scoped Attribute
- HTML | <th> valign Attribute
- HTML | <col> align Attribute
- HTML | poster Attribute
- HTML | Class Attribute
- HTML | style attribute
- HTML | oninvalid Event Attribute
- HTML | <select> autocomplete Attribute
- HTML & CSS | Tabindex attribute & Navigation bars
- HTML | <table> bgcolor Attribute
- HTML | onsubmit Event Attribute
- HTML | onunload Event Attribute
- HTML | srcdoc Attribute
- HTML | Marquee truespeed attribute
- HTML | onkeyup Event Attribute
- HTML | ondrop Event Attribute
- HTML | <td> abbr Attribute
- HTML | onpageshow Event Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.