Design comparison
Solution retrospective
Many thanks to @AdrianoEscarabote for his help, I was able to complete the challenge.
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi Jair Rodriguez, how are you?
I really liked the result of your project, but I have some tips that I think you will enjoy:
I will try to help you with your problem!
I analyzed your code! To start I will get the buttons by the class so it will look like this:
const numbers = document.querySelectorAll(".span");
I removed this:
// const uno = document.querySelector("#uno") // const dos = document.querySelector("#dos") // const three = document.querySelector("#three") // const four = document.querySelector("#four") // const five = document.querySelector("#five")
and also removed the function called
scaner!
I added this:
numbers.forEach((element) => { element.addEventListener("click", () => { selected.innerText = `You selected ${element.innerText} out of 5` submit.addEventListener("click", () => { wrapper.style.transform = "rotateY(-180deg)"; }); }) })
I added the submit event inside the other, to create a scheme that as long as the user doesn't click on the number, the submit button won't work!
Another tip is about the color of the buttons:
instead of using this function:
numbers.forEach((num) => { num.addEventListener("click", function click() { num.setAttribute("style", "background : hsl(217, 12%, 63%); color: white"); }); });
use this:
.span::focus { background-color: white; }
Tell me if it was easy to understand ahuauahuah
The rest is great!
I hope it helps... π
Marked as helpful0@JairthPosted about 2 years ago@AdrianoEscarabote Thank you very much! I see that I was close to the answer, I had tried your method but I failed in some statements. Thank you very, very much!
1
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