English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
name属性指定下拉列表的名称,name属性用于引用JavaScript中的元素,或在提交表单后引用表单数据。
带有 name 属性的下拉列表:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML select name 属性使用-基础教程(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 refer to elements in JavaScript, or to reference form data after form submission.
None.
<select name="text">
Value | Description |
---|---|
text | Name of the dropdown list. |