codex-lv2-may-2025

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


đź§Ş Level 26: Valid Input Handling

What You’ll Do

Complete your validation logic by handling valid (non-empty) input.

Instructions

Add the else condition for when the input has text:

đź’ˇ Code Hints

Completing your if/else structure? You already have the if part from Level 25. Now add the else part to handle when the input is NOT empty. This creates a complete validation system that handles both cases.

âś… Check

  1. Open your webpage in a browser
  2. Type something in the input field (like “Hello”)
  3. Click your Send button
  4. You should see “Thinking…” appear in the output area
  5. The message should be styled differently from the error message (maybe blue or neutral color)
  6. Open Chrome DevTools (F12) and check the Console tab for any errors
  7. If you see the error message instead, check that your condition is checking for non-empty input correctly

Next: Level 27 - Add Validation Area



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