<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>IE6下select控件option的模拟禁用</title>
<script>
function deal(id) {
var s = document.getElementById(id).options;
var l = s.length;
for(var i=0; i<l; i++){
if(s[i].disabled && s[i].selected) {
s[0].selected = "selected";
break;
}
}
}
</script>
</head>
<body>
请您选择无烟城市可以乘坐的最佳交通工具:
<select id="transport" onchange="deal('transport');">
<option>==请选择==</option>
<option>自行车</option>
<option style="color:#999999" disabled="disabled">奔驰</option>
<option>毛驴</option>
<option style="color:#999999" disabled="disabled">臭脚</option>
</select>
</body>
</html>
IE6下select控件option的模拟禁用
最新推荐文章于 2017-05-23 17:43:56 发布