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

HTML 参考手册

HTML 标签大全

HTML select multiple 属性

multiple 属性是布尔属性,multiple 属性指定可以一次选择多个选项。

 HTML <select> Tag

在线示例

允许多个选择的下拉列表:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <select> multiple 属性使用-基础教程(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php">
<select multiple>
  <option value="PHP">PHP</option>
  <option value="Python">Python</option>
  <option value="C#">C#</option>
  <option value="Golang">Golang</option>
</select>
</form>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the multiple attribute.

Definition and Usage

The multiple attribute is a boolean attribute.

The multiple attribute specifies that multiple options can be selected at once.

Selecting multiple options varies between different operating systems and browsers:

  • For Windows: Hold down the Control (ctrl) button to select multiple options

  • For Mac: Hold down the command button to select multiple options
    The use of checkboxes is more user-friendly because the way this operation is performed is different, and because it is necessary to inform the user that multiple selections can be made.

HTML 4.01 With HTML5Differences

None.

Differences between HTML and XHTML

In XHTML, attribute abbreviation is prohibited, the multiple attribute must be defined as <select multiple="multiple">.

Syntax

<select multiple>
 HTML <select> Tag