Submitted almost 4 years ago
Intro component with sign up form using HTML, CSS and JS
@shadib0797
Design comparison
SolutionDesign
Solution retrospective
Any suggestions on how can make my code neater.
Community feedback
- @MisterEdelPosted almost 4 years ago
Hi Shadib, it looks good. I have some suggestions to your code:
- Add labels to the input, you can hide them with something like bootstraps
.sr-only
class
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
- Use a real button, instead of
div role="button"
you could usebutton type="submit"
0@shadib0797Posted almost 4 years ago@MisterEdel that's what i want to know why my JS validation changes does not persist when using button type="submit" or any other, they show up like for 1 sec and then disappears.
0@MisterEdelPosted almost 4 years ago@shadib0797 you could use
preventDefault
on the click event to stop the submission if there are errors. See here: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault0 - Add labels to the input, you can hide them with something like bootstraps
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