Design comparison
Solution retrospective
I did not implement the button on the detail page because the names of the border countries are abbreviated, how could I use the given api to make this buttons work.
Community feedback
- @SteentoonsPosted over 2 years ago
From the data, each country has
cca3
that has the abbreviations. You can use this to your advantage by using the currentcca3
to return the whole country object. This can then be used to create the details for that particular country. In short, after clicking a border, you can get theinnerHTML
and check itscca3
from the data (use the lowercase version compared withname.common
). after getting the country that matches the name, use the country's object to create the detailed contents. I hope you get the ideaMarked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord