English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The name attribute specifies the name of the dropdown list, and it is used to reference elements in JavaScript or to reference form data after submitting the form.
Dropdown list with name attribute:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML select name attribute usage-Basic Tutorial(oldtoolbag.com)</title> </head> <body> <form action="action_page.php"> <select name="lan"> <option value="PHP">PHP</option> <option value="Python">Python</option> <option value="C#">C#</option> <option value="Golang">Golang</option> </select> <input type="submit"> </form> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the name attribute.
The name attribute specifies the name of the dropdown list.
The name attribute is used to reference elements in JavaScript, or to reference form data after form submission.
None.
<select name="text">
Value | Description |
---|---|
text | Name of the dropdown list. |