HTML <select> name attribute
Definition and usage
name
The attribute specifies the name of the dropdown list.
name
The attribute is used to reference elements 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>
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 |