Design comparison
Community feedback
- @ricoomPosted about 1 year ago
Hello @Osereme congratulations on completing this challenge. I have some few observations that I believe may help you improve your code. 1.make use of the JavaScript Validation API to avoid reinventing the wheel and get the best from html5. the API has methods that enable you to not only check for input errors but also give you ready messages to display to client. you can achieve this by adding a span to the input. input.checkValidtiy() is one of the useFul methods that come in handy in this challenge. eg.
submit.addEventListener('click',(e)=>{ e.preventDefault();
if(input.checkValidity()){ // some code }else{
//display error err.innerText=input.validationMessage; }
})
2.mark the email input as required to avoid creating hardcoded not-null message. I hope you find these observation helpful. happy coding 😉
Marked as helpful0@Dev-simeon-techPosted about 1 year agoHello @ricoom thanks for the advice on the API and required input attribute i will work on it.
1
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