Rest Countries API

Solution retrospective
What can I do to improve it and please don't forget to give me your feedback :)
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Aya-Saeed261
Hey @JAHMD! congratulations on finishing the challenge 🎉 It looks great and there some features I'm thinking about stealing and using in my solution👀
I have a couple of suggestions:
- Wrap the filter button (mode button and border countries buttons as well) between button tag instead of div tags, this way it will be more semantic and also accessible by keyboard so better accessibility
<button type="button" id="filter-btn">.</button>
- Bad value
Saint Lucia
for attributeid
on elementdiv
: An ID must not contain whitespace.: To fix this problem, replace whitespaces with hyphens.
cardContainer.id = country.name.common.replaceAll(" ", "-");
- Element
p
not allowed as child of elementbutton
in this context: To fix this problem, use a span tag instead of the p tag for the text in the back button.
Hope this helps, keep it up ✌️
Marked as helpful - @denielden
Hello Ahmed, You have done a good work! 😁
Some little tips to improve your code:
- use
article
tag instead of a simplediv
to the container card for improve the Accessibility - add descriptive text in the
alt
attribute of the images not a simple flag for all - remove all unnecessary code, the less you write the better as well as being clearer: for example the
div
container of flag images - use
ul
element for the details text of country instead of multiplep
- I would also add a query reset button, I find it very convenient
Keep learning how to code with your amazing solutions to challenges.
Hope this help 😉 and Happy coding!
Marked as helpful - use
Join 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