HTML <select> name attribute

Definition and Usage

name This attribute specifies the name of the dropdown list.

name This attribute is used to reference an element in JavaScript, or to reference form data after the form is submitted.

Example

Dropdown list with name attribute:

<label for="cars">Please select a car brand:</label>
<select name="cars" id="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

Syntax

<select name="text">

Attribute Value

Value Description
text Specify the name of the dropdown list.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support