Comment: The emergence of HTML5 provides us with some attributes, and we can solve the content of this verification form without writing js and rules. Here is a description of the definitions of valid, invalid, and required.
The css3 prompt is only available for advanced browsers:Chrome
Firefox
Safari
IE9+
Definitions of valid, invalid, required
The code is as follows
input:required, input:valid , input:invalid{border:0 none; outline: 0 none; -webkit-box-shadow:none; -moz-box-shadow:none; -ms-box-shadow:none; -o-box-shadow:none; box-shadow:none;}
In the past, the verification form will use js and regularity to determine whether the filled-in content is correct, such as email verification.
The emergence of HTML5 provides us with some attributes, and we can solve the content of this verification form without writing js and rules.
:required
Must, that input cannot be empty.
:valid
Valid, that is, it is triggered when the filled-in content meets the requirements.
:invalid
Invalid, that is, it is triggered when the filled-in content does not meet the requirements.