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 elements -->


The following is an example of an HTML form that features <input> elements:

<!DOCTYPE html>
<head> </head>
<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" />

Video Walkthrough

Watch this video for a step-by-step tutorial on creating HTML forms.

Looking to contribute?

Learn HTML on Codecademy