Latest web development tutorials

HTML select required attributes

HTML select tag Reference Manual HTML <select> tag

Examples

With a drop-down list the required HTML form:

<form action="demo_form.html">
<select required>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<input type="submit">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Almost all of the major browsers do not support the required properties.


Definition and Usage

required attribute is a Boolean attribute.

required attribute specifies the user before submitting the form you must choose a value.


Differences between HTML 4.01 and HTML5

required attribute is new in HTML5 attributes.


Differences between HTML and XHTML

In XHTML, prohibit attribute minimization, required attributes must be defined as <select required = "required" />.


grammar

<select required>


HTML select tag Reference Manual HTML <select> tag