Skip to main content
FREE Mock interview & resume review with Sumit. Free right now, no payment needed.Book a slot

HTML Form Input Types — Complete Reference

Complete HTML Handbook

Beginner to Advanced — Tags, Forms, SEO, Accessibility & Interview Prep

138 tags150 interview Qs60 challenges

The input type="text" control provides a specialized widget for text data in HTML forms.

Validation: Optional pattern, minlength, maxlength

<input type="text" name="name" required minlength="2">

The input type="password" control provides a specialized widget for password data in HTML forms.

Validation: minlength; never echo value

<input type="password" name="pwd" autocomplete="current-password">

The input type="email" control provides a specialized widget for email data in HTML forms.

Validation: Built-in email format check

<input type="email" name="email" required>

The input type="number" control provides a specialized widget for number data in HTML forms.

Validation: min, max, step

<input type="number" name="qty" min="1" max="99">

The input type="date" control provides a specialized widget for date data in HTML forms.

Validation: ISO date; min/max

<input type="date" name="dob">

The input type="datetime-local" control provides a specialized widget for datetime-local data in HTML forms.

Validation: Local datetime without timezone

<input type="datetime-local" name="meeting">

The input type="month" control provides a specialized widget for month data in HTML forms.

Validation: YYYY-MM

<input type="month" name="period">

The input type="week" control provides a specialized widget for week data in HTML forms.

Validation: YYYY-W##

<input type="week" name="week">

The input type="time" control provides a specialized widget for time data in HTML forms.

Validation: HH:mm

<input type="time" name="alarm">

The input type="url" control provides a specialized widget for url data in HTML forms.

Validation: URL format

<input type="url" name="website" placeholder="https://">

The input type="tel" control provides a specialized widget for tel data in HTML forms.

Validation: Telephone; pattern optional

<input type="tel" name="phone" pattern="[0-9]{10}">

The input type="color" control provides a specialized widget for color data in HTML forms.

Validation: Hex color #rrggbb

<input type="color" name="theme" value="#2563eb">

The input type="range" control provides a specialized widget for range data in HTML forms.

Validation: min, max, step

<input type="range" name="volume" min="0" max="100">

The input type="search" control provides a specialized widget for search data in HTML forms.

Validation: Search field semantics

<input type="search" name="q" placeholder="Search...">

The input type="file" control provides a specialized widget for file data in HTML forms.

Validation: accept, multiple

<input type="file" name="resume" accept=".pdf">

The input type="hidden" control provides a specialized widget for hidden data in HTML forms.

Validation: No UI; still submitted

<input type="hidden" name="csrf" value="token">

The input type="radio" control provides a specialized widget for radio data in HTML forms.

Validation: Same name groups options

<input type="radio" name="plan" value="pro" checked>

The input type="checkbox" control provides a specialized widget for checkbox data in HTML forms.

Validation: checked boolean; value when checked

<input type="checkbox" name="agree" required>

The input type="submit" control provides a specialized widget for submit data in HTML forms.

Validation: Submits form

<input type="submit" value="Send">

The input type="reset" control provides a specialized widget for reset data in HTML forms.

Validation: Resets form defaults

<input type="reset" value="Clear">

The input type="button" control provides a specialized widget for button data in HTML forms.

Validation: Generic button; no default submit

<input type="button" value="Click me">

The input type="image" control provides a specialized widget for image data in HTML forms.

Validation: Submit with coordinates

<input type="image" src="submit.png" alt="Submit">