Home > Web Front-end > H5 Tutorial > The definition of valid, invalid and required in html5_html5 tutorial skills

The definition of valid, invalid and required in html5_html5 tutorial skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 15:48:22
Original
2662 people have browsed it

css3 prompt only applies to advanced browsers:

Chrome
Firefox
Safari
IE9

The definitions of valid, invalid, and required

The code is as follows

Copy code
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, verification forms would use js and regular expressions to determine whether the filled-in content was correct, such as email verification.

The emergence of HTML5 provides us with some attributes, so we can solve this inspection form content without writing js and regular expressions.
:required
Must, that means the input cannot be empty.

:valid
is valid, that is, it is triggered when the filled in content meets the requirements.

:invalid
Invalid, which is triggered when the filled in content does not meet the requirements.
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
html5 validation for symfony 2.1
From 1970-01-01 08:00:00
0
0
0
The difference between HTML and HTML5
From 1970-01-01 08:00:00
0
0
0
html5 show hide
From 1970-01-01 08:00:00
0
0
0
Can PDF files run HTML5 and Javascript?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template