编程论坛
注册
登录
编程论坛
→
JavaScript论坛
javascript问题咨询
zxwd
发布于 2013-11-08 16:02, 519 次点击
checkbox选中,同一行的列表框可用,取消选中,则该列表框禁止使用,用javascript能实现吗?
3 回复
#2
hugeannex
2013-11-11 10:09
能,能,能
#3
surfie
2013-11-15 18:30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js checkbox listbox</title>
</head>
<input type="checkbox" id="cbox" onclick="check()" /><select><option>列表1</option><option>列表2</option><option>列表3</option></select>
<script>
function check(){
var oBox=document.getElementById('cbox');
if(oBox.checked==true){
document.getElementsByTagName('select')[0].disabled=true;
}else{document.getElementsByTagName('select')[0].disabled=false;
}
}
</script>
<body>
</body>
</html>
#4
渴望做梦
2015-02-13 14:47
楼上说的对
1