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

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

HTML DOM disabled 属性


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

Definition and Usage
定义与用法

The disabled property sets or returns whether or not the drop-down list should be disabled.
disabled属性可设置或返回下拉列表的状态

Syntax 语法

selectObject.disabled=true|false


Example 举例

<html>
<head>
<script type="text/javascript">
function disable()
{
document.getElementById("mySelect").disabled=true
}
function enable()
{
document.getElementById("mySelect").disabled=false
}
</script>
</head>
<body>
<form>
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
<input type="button" onclick="disable()" value="Disable list">
<input type="button" onclick="enable()" value="Enable list">
</form>
</body>
</html>


演练

Disable and enable a dropdown list
禁用和启用下拉列表

评论 (0) All

登陆 | 还没注册?