If you require older browser support, either polyfill, or use these selectors in non-critical ways á la progressive enhancement, which is recommended. However, modern browser support is getting better. :valid was introduced in CSS Selectors Module 3, which means old versions of browsers do not support it.
![for which of the following does css validation check? for which of the following does css validation check?](https://kodepundit.com/wp-content/uploads/2019/06/valid-invalid-css-selectors-1024x576.png)
Note how the first (“Email”) is green-valid-even when there is no content in the field.
![for which of the following does css validation check? for which of the following does css validation check?](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/HTML_and_CSS/atom-htmltidy.png)
See the Pen :valid & :invalid inputs by Chris Coyier ( on CodePen Depending upon the returned value the form will submit. That will first validate the form fields and will return a boolean value either true or false.
![for which of the following does css validation check? for which of the following does css validation check?](https://www.freecodecamp.org/news/content/images/2019/12/reactiveFormValidation.gif)
In our example, we call ValidationEvent () function on form submission.
The example below uses CSS to turn the “Email” fields red or green, responding to the whether or not the contents match a valid email address pattern: Invoking JavaScript function on form submission: