实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function selectMultiple()
6
{
7
document.getElementById("mySelect").multiple=true;
8
}
9
</script>
10
</head>
11
<body>
12
13
<form>
14
<select id="mySelect" size="4">
15
    <option>Apple</option>
16
    <option>Pear</option>
17
    <option>Banana</option>
18
    <option>Orange</option>
19
</select>
20
<input type="button" onclick="selectMultiple()" value="Select multiple">
21
</form>
22
<p>Before you click on the "Select multiple" button, try to select more than one option (by holding down the Shift or Ctrl key). Then click on the "Select multiple" button and try again.</p>
23
24
</body>
25
</html>