Design comparison
Solution retrospective
Any feedback, especially about JS is appreciated!
Community feedback
- @A-amonPosted over 3 years ago
Hello! Great work~
I have a few suggestions:
-
Set the textContent of error message in JS instead of having a fixed message in HTML. Sometimes, the messages can be specific e.g. Please do not leave this field empty or Password has to be at least 6 characters long, etc. Doing this will also help you avoid setting the style property directly on JS e.g. style.display ,etc.
-
Use a form instead of div for form-related items. This way, you can also addEventListener to submit event (which allows user to press Enter to submit too instead of just via clicking button)
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