HTML Input Types
Use text, email, password, number, date, and other input types.
Category: HTML | Lesson: 12 of 40
Common input types
<label for="name">Name</label>
<input id="name" name="name" type="text" autocomplete="name">
<label for="email">Email</label>
<input id="email" name="email" type="email" autocomplete="email" required>
<label for="password">Password</label>
<input id="password" name="password" type="password" autocomplete="new-password">
<label for="age">Age</label>
<input id="age" name="age" type="number" min="1" max="120">
<label for="date">Preferred date</label>
<input id="date" name="date" type="date">
More types
tel, url, search, time, datetime-local, month, week, range, color, file, checkbox, radio, hidden, submit, and reset are also available.
Useful attributes
placeholder is a hint, not a label. required makes a field mandatory. min, max, step, minlength, maxlength, autocomplete, and multiple control behaviour.
Practice
Build a registration form with name, email, phone, password, date, and file upload.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses