Forms

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> tag, which contains various labels and inputs.

Example

The following example

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

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn HTML on Codecademy