English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die select required-Eigenschaft ist eine boolesche Eigenschaft, die angibt, dass der Benutzer vor dem Absenden des Formulars einen Wert auswählen muss.
HTML-Formular mit einer obligatorischen Auswahlbox:
<form action="action_page.php"> <select name="lan" required> <option value="PHP">PHP</option> <option value="Python">Python</option> <option value="C#">C#</option> <option value="Golang">Golang</option> </select> <input type="submit"> </form>Test and see ‹/›
IEFirefoxOperaChromeSafari
Almost all mainstream browsers do not support the required attribute.
The required attribute is a boolean attribute.
The required attribute specifies that a user must select a value before submitting the form.
The required attribute is in HTML5 with the new attributes.
In XHTML, attribute abbreviation is prohibited, the required attribute must be defined as <select required="required" />。
<select required>HTML <select> Tag