English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The select required attribute is a boolean attribute that specifies that a value must be selected before the form can be submitted.
HTML form with a required dropdown list:
<form action="action_page.php"> <select name="lan" required> <option value="PHP">PHP</option>/option> <option value="Python">Python</option>/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 newly added attributes.
In XHTML, attribute abbreviations are prohibited, the required attribute must be defined as <select required="required" />。
<select required>HTML <select> tag