🌐HTML Input Element
Also known as <input>, Input Tag, Input Field, Form Input
The HTML tag for a box you fill in, like a text box or a tick box.
Think of it like
It is like a blank on a paper form. You write your answer in the box.
Example
Lucy's sign-up form uses type email for the email box. On a phone, the keyboard now shows an @ key, and the browser checks the address.
Why it matters
The right type gives people the right keyboard and free checks. A date type even brings its own calendar.
Definition
Example code
html
<label for="email">Email</label>
<input id="email" type="email" name="email" required>Common mistake
Key takeaways
- 1Type decides. The type sets the box and its checks.
- 2No closing tag. It is one tag, with no end tag.
- 3Always labelled. A label says what goes in the box.