HTML Form Elements

This chapter describes all the different HTML form elements.

The HTML <form> Elements

The HTML <form> element can contain one or more of the following form elements:

  • <input>
  • <label>
  • <select>
  • <textarea>
  • <button>
  • <fieldset>
  • <legend>
  • <datalist>
  • <output>
  • <option>
  • <optgroup>

The <input> Element

One of the most widely used forms of the <input> element form.

The <input> element can be displayed in a number of ways, depending on the attribute type.


Example
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">