HTML DOM multiple 屬性
定義和用法
multiple 屬性可設(shè)置或返回是否可有多個(gè)選項(xiàng)被選中。
注釋:Opera 9 無(wú)法在腳本中設(shè)置該屬性,僅能返回它。
語(yǔ)法
selectObject.multiple=true|false
實(shí)例
The following example returns the id of the dropdown list:
<html>
<head>
<script type="text/javascript">
function selectMultiple()
{
document.getElementById("mySelect").multiple=true
}
</script>
</head>
<body>
<form>
<select id="mySelect" size="4">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
<input type="button" onclick="selectMultiple()"
value="Select multiple">
</form>
</body>
</html>