HTML · Forms and controls

input

A single-line control. The type decides validation, keyboard and autofill behaviour.

Syntax
<input type="…" name="…" id="…">

Example

Try it

Notes

Always give an input an id that a label can reference. On mobile, type="email" shows the right keyboard.

More in this group

button datalist fieldset form input types label legend meter

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course