Responsive Advice generator app using flex

Please log in to post a comment
Log in with GitHubCommunity feedback
- @Dytoma
Hey👋 Good job on completing this challenge.
However I do have some suggestions to improve your solution. -The dice is supposed to on Click get provide a new advice to the user so instead of using a div to wrap it I will suggest using a button and add some accessibility to it. Instead of
<div class="green-circle"><i class="fa-solid fa-dice-five black"></i></div>
I will suggest this code<button class="green-circle" aria-label="new advice"><i class="fa-solid fa-dice-five black" aria-hidden="true"></i></button>
.You can read more about accessibility on MDN ARIA Docs 📚
- You can also select this button element in your
main.js
file and add anevent listener (click)
and trigger the function that fetches the advice as a call back.
Code:
document.queryselector(button).addEventListener('click', () => getQuotes()
Happy coding😇
Marked as helpful - You can also select this button element in your
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