Design comparison
SolutionDesign
Community feedback
- @BaptisteDCLPosted almost 2 years ago
You code is great ! But if i had to be a bit picky and give you advices to get a more efficient javascript, and ultimately code faster, I would've told you to stop creating variables that you only use once like your variable "button". You could have wrote this :
document.querySelector(".button").addEventListener("click", (e) => { if (rating !== undefined) { rating_card.classList.add("hidden"); thank_you_card.classList.remove("hidden"); } const result = document.querySelector(".result"); result.textContent = `You selected ${rating} out of 5`; });
But crazy work nonetheless :)
1@rathore-himanshuPosted almost 2 years ago@BaptisteDCL Thanks for your suggestion.
0
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