Design comparison
Solution retrospective
Hello everyone! Hope everyone is having fun with the challenges!
This is the first time that I feel like everything is working. But the problem is that the way I approached Javascript feels like is not the most optimal way. If you can see a way of making it better I would really appreciate your comments. : )
Thank you!
Community feedback
- Account deleted
Hi there 👋
Congratulate on finishing your project 🎉. You did a great job 💡
I give some suggestions to help you take your project design to the next level 📈😉
- Put the Terms And Services text inside the
<a>
element because this always opens a link in websites - Replace all this code with down below, I haven't tested yet but It should work
const elements = ['#first-name', '#last-name', '#password']; elements.forEach(elId => { // put this always at the top of the block e.preventDefault(); const el = document.querySelector(`${elId}`); const closestEl = el.closest('.input').classList; if (el.value.length === 0) closestEl.add('error'); else closestEl.remove('error'); })
Happy coding ☕
Maqsud
Marked as helpful0@LfrancosPosted almost 3 years ago@maqsudtolipov Thank you soo much for the help! This is going to help me a ton! I'll try to implement what you have in here. I get the idea now I'll see if I can implement it : )
Thank you so much!
1 - Put the Terms And Services text inside the
- @optimusprime202Posted almost 3 years ago
Hey @Lfrancos, You did this very well.
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