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 "".
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
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>
Output results:
(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!