Interactive World Map
A clickable SVG world map: hover to highlight a country, click to see its capital, area, currency and languages, fetched live from a public REST API.
How it works
- Uses JavaScript DOM APIs to add hover and click handling to every country path in the SVG.
- Fetches country data from the countries.dev REST API with the Fetch API and handles failed HTTP responses.
- Some country names return several records, so the matching logic prefers an exact name match, then the most populous partial match, then falls back to the first result.
- Updates the info panel from the JSON response, with “N/A” fallbacks for missing fields.