HTMLHTML Input Types

The <input> tag has many type attributes to create different input fields:

  • text: Single-line text
  • email: Validates email format
  • number: Accepts only numbers
  • password: Hides typed text
  • checkbox, radio: Options
  • file: Upload files
<form>
  <input type=\"text\" placeholder=\"Your name\" /><br />
  <input type=\"email\" placeholder=\"Your email\" /><br />
  <input type=\"number\" placeholder=\"Your age\" /><br />
  <input type=\"password\" placeholder=\"Password\" /><br />
  <input type=\"checkbox\" /> I agree<br />
  <input type=\"file\" /><br />
</form>