You can use standard CSS validation classes to control the display of valid and invalid form elements - such as:
/* Selects any valid <input> */
input:valid {
background-color: powderblue;
}
/* Selects any invalid <input> */
input:invalid {
background-color: pink;
}(From the excellent documentation at https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation)
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article