Skip to content

Important Tags (2)

Form Tags

A very important set of tags concerns forms, which allow interactions with the user.

  • <form> To indicate a form
  • <input type="text|checkbox|radio|number|date|color..." Allows the user to enter information
  • <select> and its child tags <option> for a list of choices
  • <textarea> to allow longer text input (a comment, for example)
html
<html>
  <form>
    <fieldset>

      <legend>Credentials</legend>

      <label>Username</label>
      <input name="username" placeholder="Username">

      <label>Password</label>
      <input name="password" type="password" placeholder="53CR37P455">

      <select name="availableOptions">
        <option value="option1">
          Option 1
        </option>
        <option value="option2">
          Option 2
        </option>
      </select>

      <textarea name="comment" rows="5" cols="60" placeholder="Any comments?"></textarea>
    </fieldset>
  </form>
</html>