codex-lv2-may-2025

Level Navigation: 1 2 3 4 5 6 7 8 9 10 11 Current Level: 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

Level 12: Input Validation

What You’ll Do

Add validation to check if the input is empty before processing.

Instructions

💡 Code Hints

Need help with validation? Check out these snippets:

✅ Check

  1. Open your webpage in a browser
  2. Click the button without typing anything - you should see an error message
  3. Type something and click the button - you should see the text you typed
  4. Clear the input and click the button again - you should see the error message again
  5. If the validation doesn’t work, check your if statement and error message



Level Navigation: 1 2 3 4 5 6 7 8 9 10 11 Current Level: 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34