Published Aug 4, 2021Updated Apr 17, 2023
Contribute to Docs
In HTML, forms are used for gathering and sending user input to an external source (like a server) for processing. This is done with the
<form> element, which contains various labels and inputs.
<form><!-- Form elements --></form>
The following is an example of an HTML form that features
<!DOCTYPE html><html><head> </head><body><form method="post" action="http://server1">Enter your name:<input type="text" name="fname" /><br />Enter your age:<input type="text" name="age" /><br /><input type="submit" value="Submit" /></form></body></html>
Watch this video for a step-by-step tutorial on creating HTML forms.
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn HTML on Codecademy
Front-End EngineerFront-end engineers work closely with designers to make websites beautiful, functional, and fast.
Includes 34 Courses
With Professional Certification