tadam logo

HTML5 <select> name Attribute

Example

A drop-down list used in a form:
<select name="carlist">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>
The output of the code above will be:

Definition and Usage

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

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

Differences Between HTML 4.01 and HTML5

None.

Syntax

<select name="value">

Attribute Values

ValueDescription
nameThe name of the drop-down list
Was this information helpful?
   

Comments