Forms and input
Lesson 15 of 20 · Web.Micro
Read what people type, check it and respond without reloading the page.
<label for="name"> connects the text to <input id="name">: clicking the label focuses the field, and screen readers announce it. type="email" or type="number" give the right keyboard on phones.
Check yourself
What does e.preventDefault() do in a submit handler?
Do it in the browser: a real HTML, CSS and JavaScript tool, a short mission and instant feedback. No install.
Start this lesson — free