Design comparison
Solution retrospective
I had some problems selecting all the radio inputs with queryselectorAll, because I could never handle how to make the events happen only to the selected input. Every time made all the changes in every input. If someone can tell me how to avoid that or share a link where I can see the resolution of that I would be really grateful.
Community feedback
- @LeonardoMancilhaPosted over 2 years ago
Hello, Saul! As far I as know for you to select all the elements radio inputs you can do -> document.querySelectorAll('input[type=radio]'); I also have some difficulties selecting all the elements type input but search on Google and you are sure going to find out the solution for you. I always look on W3Schools for example and other websites such as StackOverflow, on Youtube, or with the communities that I have on Discord.
1@xsaulPosted over 2 years agoHello Leonardo, I did select the elements with document.querySelectorAll('input[type=radio]'); but the problem was that when I clicked any of the inputs in the site the function was activated in all the inputs.
The function was when I click on any of the inputs add a green border to that input but with my code, it added the border to all the inputs.
And I could never make it work like that, so I selected the inputs one by one. But I know that isn't the best way to do it 😅.
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