HTML & CSS Input Types & Validation Quiz

This HTML quiz covers input types like email, number and tel and the browser's built-in constraint validation. You will predict which values pass required, pattern, min and step, and why the server still has to check everything.

Medium 10 questions ~6 minutes Pass at 80%

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

The user types hello and clicks Send. What happens?

<form action="/join">
  <input type="email" name="e">
  <button>Send</button>
</form>
Show the answer

B. The browser blocks the submission and shows a validation message A non-empty type="email" field must contain a valid email address, so the browser stops the submit and shows a message. Note that an empty field would pass, because the field is not required.

What this quiz covers

  • email, number, tel and what each one checks
  • required, pattern, min, max, step and maxlength
  • novalidate and client vs server validation
  • Placeholders vs labels
  • autocomplete tokens

Questions people ask

Do I need an account?

No. Anyone can play. Sign in to keep your XP, streak, badges and history.

Can I retake it?

Yes. Your best score is kept, and the questions and answers are shuffled each time.