当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM disabled 属性
The disabled property sets or returns whether or not the drop-down list should be disabled.
disabled属性可设置或返回下拉列表的状态
selectObject.disabled=true|false |
<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