An HTML form passes data through a server, either creating a database or sending the form to your email. An HTML form can contain many different elements like text fields, radio-buttons, checkboxes, password field, and more. The form can also allow to select from a list, have a textarea, legend, and label elements. The <form> tag is used to create an HTML form.
Text Fields
The <input type=”text”> tag defines a one-line text field that a user can input text into.
<form>
First name:<input type=“text” name=“firstname”><br>
Last name:<input type=“text” name=“lastname”>
</form>
Password Field
<html><body>
<h3>Send e-mail to someone@example.com</h3>
<form action=“MAILTO:someone@example.com“ method=“post” enctype=“text/plain”>
Name:<br> <input type=“text” name=“name” value=“your name”><br>
E-mail:<br> <input type=“text” name=“mail” value=“your email”><br>
Comment:<br> <input type=“text” name=“comment” value=“your comment” size=“50”><br><br>
<input type=“submit” value=“Send”> <input type=“reset” value=“Reset”></form></body></html>