HTML5 Forms Reference

HTML5 form elements, input types, and validation attributes

Input Types

 type="text"> # text input
 type="email"> # email validation
 type="password"> # password field
 type="number"> # numeric input
 type="date"> # date picker
 type="color"> # color picker

Validation Attributes

 required> # field required
 minlength="3" maxlength="10"> # length limits
 min="1" max="100"> # number range
 pattern="[A-Za-z]{3}"> # regex pattern
 placeholder="Enter name"> # placeholder text

Form Elements

 rows="4" cols="50" # multi-line text

 # dropdown

 type="checkbox" checked> # checkbox
 type="radio" name="group"> # radio button

Form Structure

 action="/submit" method="post">
   for="name">Name: # label for input
   id="name" name="name">
  
  
# group fields Personal Info

Buttons & Submit

 type="submit">Submit # submit form
 type="reset">Reset # reset fields
 type="button">Click # regular button

 type="submit" value="Send"> # submit input
 disabled>Disabled # disabled button