Form using 'if' and 'classList.add '

Solution retrospective
I prefer adding a different class to display errors rather than using a string template or similar methods. I think this approach makes the code look cleaner :)
What challenges did you encounter, and how did you overcome them?I had never worked on changing the style of a 'form' before, so I had to do some research on how to hide the default alerts and how the submit event works in JS. At first, I used onsubmit, then onclick on a button, and finally, I used submit on the form itself.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Nico Velasco's solution.
Join 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