Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML select required attribute

HTML tag

Example

An HTML form with a required drop-down list:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Almost all major browsers do not support the required attribute.


Definition and Usage

The required attribute is a boolean attribute.

The required attribute specifies that the user must 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 HTML tag