codex-lv2-may-2025

Level Navigation: 1 2 3 4 5 6 7 8 Current Level: 9 10

🎯 Challenge Part 2: Add a Second City Button (Same Page)

Goal: Add a second city button to the same page, allowing users to switch between cities.


📋 What You’ll Do

  1. Add a second button to your HTML for a different city (like Atlanta)
  2. Add weather data for the second city as a new POJO in your script
  3. Create a second event listener that displays the second city’s weather in the same card

🚀 Challenge Instructions

Work in the same index.html and script.js files:

  1. Add a second button to your HTML for a different city (like Atlanta)
  2. Add weather data for the second city as a new POJO in your script
  3. Create a second event listener that displays the second city’s weather in the same card

Important: Don’t create a second card! Use the same card HTML and just change the data when different buttons are clicked.

Challenge: Implement this yourself! You’ll need to:


💡 What You’ll Learn


Check Your Work


🔗 Navigation


Ready for the final challenge? Continue to Challenge Part 3: Multiple City Buttons


Level Navigation: 1 2 3 4 5 6 7 8 Current Level: 9 10