@ricoom
Posted
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 helpful
@Dev-simeon-tech
Posted
Hello @ricoom thanks for the advice on the API and required input attribute i will work on it.