1
回答
请大侠们帮忙,进来看。
注册华为云得mate10,2.9折抢先购!>>>   
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="layout" content="main">
<title></title>
<script language="javascript">
function ChkAllClick(sonName, cbAllId){
var arrSon = document.getElementsByName(sonName);
var cbAll = document.getElementById(cbAllId);
var tempState=cbAll.checked;
for(i=0;i<arrSon.length;i++) {
if(arrSon[i].checked!=tempState)
arrSon[i].click();
}
}

function ChkSonClick(sonName, cbAllId) {
var arrSon = document.getElementsByName(sonName);
var cbAll = document.getElementById(cbAllId);
for(var i=0; i<arrSon.length; i++) {
if(!arrSon[i].checked) {
cbAll.checked = false;
return;
}
}
cbAll.checked = true;
}
</script>
<script language="JavaScript">
function dropDownList(){
if($("option:checked")){

}
}
</script>
</head>
<body>
<div id="warp">
<div class="content">
<table width="250" border="0" cellspacing="0" cellpadding="0">
<tr>
<th height="30" width="50"><INPUT name="chkAll" id="chkAll" title="ALL" onClick="ChkAllClick('chkSon','chkAll')" type="checkbox" />
ALL </th>
<th width="100"><select name="" style="width:100px" >
<option value ="">a</option>
<option value ="">b</option>
<option value ="">c</option>
</select>
<p>11111111</p></th>
<th width="100"><select name="" style="width:140px" >
<option value ="">1</option>
<option value ="">2</option>
<option value="">3</option>
</select>
<p>222222222</p></th>
</tr>
<tr>
<td><INPUT name="chkSon" id="chkSon1" type="checkbox" value='1' onClick="ChkSonClick('chkSon','chkAll')" /></td>
<td><select name="" style="width:100px;" >
<option value ="">a</option>
<option value ="">b</option>
<option value ="">c</option>
</select></td>
<td><select name="" style="width:140px" >
<option value ="">1</option>
<option value ="">2</option>
<option value ="">3</option>
</select></td>
</tr>
<tr>
<td><INPUT name="chkSon" id="chkSon1" type="checkbox" value='1' onClick="ChkSonClick('chkSon','chkAll')" /></td>
<td><select name="" style="width:100px;" >
<option value ="">a</option>
<option value ="">b</option>
<option value ="">c</option>
</select></td>
<td><select name="" style="width:140px" >
<option value ="">1</option>
<option value ="">2</option>
<option value ="">3</option>
</select></td>
</tr>
<tr>
<td><INPUT name="chkSon" id="chkSon1" type="checkbox" value='1' onClick="ChkSonClick('chkSon','chkAll')" /></td>
<td><select name="" style="width:100px;" >
<option value ="">a</option>
<option value ="">b</option>
<option value ="">c</option>
</select></td>
<td><select name="" style="width:140px" >
<option value ="">1</option>
<option value ="">2</option>
<option value ="">3</option>
</select></td>
</tr>
</table>
</div>
</div>
</body>
</html>
如何实现选中左边的checkbox,修改上边的dropdownlist,下边的dropdownlist也相应的修改,希望大侠指点小弟,已经被这个问题困扰很长时间了,真的谢谢了。
<无标签>
举报
钟颖
发帖于5年前 1回/195阅
顶部