English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das Attribut input required ist ein boolches Attribut. Wenn das Attribut required vorhanden ist, wird angegeben, dass das Eingabefeld ausgefüllt werden muss, bevor das Formular eingereicht wird.
HTML-Formular mit obligatorischem Eingabefeld:
<!DOCTYPE html> <html> <head> <title>HTML: <input> required Eigenschaft - Grundlegendes Tutorial-Netz(oldtoolbag.com)</title> <body> <form action="action_page.php"> Benutzername: <input type="text" name="usrname" required> <input type="submit"> </form> </html>Testen, sehen Sie ‹/›
The numbers in the table indicate the first browser version that supports the attribute.
Attribute | |||||
---|---|---|---|---|---|
required | 5.0 | 10.0 | 4.0 | 5.0 | 9.6 |
The required attribute is a boolean attribute.
If the required attribute exists, it specifies that the input field must be filled out before submitting the form.
Note:The required attribute applies to the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.
The required attribute is an HTML5 with the new attributes.
In XHTML, attribute abbreviations are prohibited, the required attribute must be defined as <input required="required" in XHTML. />。
<input required>HTML <input> Tag