html tutorial - method Attribute in HTML - html5 - html code - html form
- The method attribute defines how to send the form-data.
- The form-data is sent to the target page that can be defined in the action attribute.
- The form-data will be sent as HTTP post transaction (with method="post") or as URL variables (with method="get").
Syntax for method attribute in HTML:
Sample Coding for method Attribute in HTML:
Code Explanation for method Attribute in HTML:
- <form> tag is used to design a form for user input.
- method attribute is used to send the form data to the URL using get method.
Output for method Attribute in HTML:
- Enter the text wikitechy in the text area.
- Click the submit button.
- After clicking the submit button, it will redirect to the same page and the name(txtname=wikitechy) has been displayed in the address bar.
Browser Support for method Attribute in HTML: