Design comparison
Solution retrospective
I will be grateful for your feedback and reviews, Cheers
Community feedback
- @BernardusPHPosted almost 2 years ago
Hello MATEUSZK1OS, I see a few problems. First it would would be better to never have duplicates of
id
, classes are another thing but I see the containers for the input there areid="value"
. Each id should and must have unique names, click here to learn more.Another problem I see is that you are using a
for loop
with yourdocument.querySelectorAll()
you think that this might loop through an array but this is actually a NodeList. It looks the same but it behaves a lot differently than an array so that is why you are getting the error:script.js:26 Uncaught TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'.
Rather use theforEach
loop as that will yield you better results than the for loop see here for more help.Also I see you missed a
classList
at this code:input[i].addEventListener('focus', ()=>{ if(input[i]/// here ///.contains('input')){ input[i].classList.remove('input'); input[i].classList.add('action'); } })
Some minor problems are there but you can check the report for that.
Hope this helps
Marked as helpful1
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