How to display error message when your input field is empty using js and css.
.you can create a function to display errors.
eg.
Function displayError (e) {
e.preventDefault();
//iterate over all input field using for each method
1
17
else{
input.classList.remove(“error “);
Input.parentElement.classList.remove(“error_message”)
}
})
}
1
16
How to display your input on real time using JavaScript.
.You can create a function to display input in real time
eg
Function displayInRealtime (){
.Target all your input field using “class” or “id”
eg
const cardNumber = document.getElementById(“number”);
1
30
