English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML select name 属性

name属性指定下拉列表的名称,name属性用于引用JavaScript中的元素,或在提交表单后引用表单数据。

 HTML <select> Tag

在线示例

带有 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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the name attribute.

Definition and Usage

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.

HTML 4.01 and HTML5differences between

None.

Syntax

<select name="text">

Attribute Value

ValueDescription
textName of the dropdown list.
 HTML <select> Tag