What does required in html5 mean?

WBOY
Release: 2022-09-02 16:09:36
Original
5941 people have browsed it

In HTML5, required means "must" and is an attribute in the specified tag; this attribute is a Boolean attribute that stipulates that the input field must be filled in before submission. If this attribute is used, the field It is required, and this attribute is a new attribute in HTML5, and the syntax is "".

What does required in html5 mean?

The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.

What does required mean in html5

required means "must"

The required attribute is a Boolean attribute. The

required attribute specifies that the input field must be filled in before submission.

If this attribute is used, the field is required (or required).

The new required attribute in Html5 can be applied to most input elements when submitting. If the content in the element is blank, submission is not allowed and information prompt text is displayed in the browser.

Examples are as follows:

<!DOCTYPE HTML>
<html>
<body>
<form action="/example/html5/demo_form.asp" method="get">
Name: <input type="text" name="usr_name" required="required" />
<input type="submit" value="提交" />
</form>
</body>
</html>
Copy after login

Output results:

What does required in html5 mean?

(Learning video sharing: css video tutorial,html video tutorial)

The above is the detailed content of What does required in html5 mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template