HTML <select> name -Attribut
Beispiel
Eine Dropdown-Liste mit einem Namensattribut:
<label for="cars">Choose a car:</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>
Definition und Verwendung
Das name
Attribut gibt den Namen für eine Dropdown-Liste an.
Das name
Attribut wird verwendet, um auf Elemente in einem JavaScript oder auf Formulardaten zu verweisen, nachdem ein Formular gesendet wurde.
Browser-Unterstützung
Attribute | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
Syntax
<select name="text">
Attributwerte
Value | Description |
---|---|
text | The name of the drop-down list |
❮ HTML <select>-Tag