当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM size 属性

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM size 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 387 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The size property sets or returns the number of rows in a drop-down list.
size属性可设置或返回下拉列表中的行数

Syntax 语法

selectObject.size=number


Example 举例

<html>
<head>
<script type="text/javascript">
function changeSize()
{
document.getElementById("mySelect").size=4
}
</script>
</head>
<body>
<form>
<select id="mySelect">
<option>Apple</option>
<option>Banana</option>
<option>Orange</option>
<option>Melon</option>
</select>
<input type="button" onclick="changeSize()"
value="Change size of list">
</form>
</body>
</html>


演练

Turn the dropdown list into a multiline list
将下拉列表转变成一个多选列表

评论 (0) All

登陆 | 还没注册?