HTML <select> nameAttribute

HTML select 标签参考手册HTML <select> Tag

Examples

A drop-down list with a name attribute:

<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute.


Definition and Usage

The name attribute specifies the name of a drop-down list.

The name attribute is used to reference elements in JavaScript, or to reference form data after a form is submitted.


Differences Between HTML 4.01 and HTML5

None.


Syntax

<select name="text">

Attribute Values

Value Description
text The name of the drop-down list.


HTML select 标签参考手册HTML <select> Tag Other Extensions