X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <select> required Attribute

HTML select Tag Reference HTML <select> tag

Example

An HTML form with a required drop-down list:

<form action="demo_form.asp">
<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 yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The required attribute is not supported in any of the major browsers.


Definition and Usage

The required attribute is a boolean attribute.

When present, it specifies the user is required to select a value before submitting the form.


Differences Between HTML 4.01 and HTML5

The required attribute is new in HTML5.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the required attribute must be defined as <select required="required" />.


Syntax

<select required>


HTML select Tag Reference HTML <select> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook