獲取table所選行某列的屬性值
var len = document.forms[0].chk.length;
for(var i=0;i<len;i++){
if(document.forms[0].chk[i].checked){
alert(document.forms[0].requestNum[i].value+"qwe");
}
}
chk為複選框name值,requestNum為列的name值
獲取複選框值
function chk(){
if(document.forms[0].chk==null){
return;
}
var chkId = '';
var len = document.forms[0].chk.length;
if(len>1){
var tag = 0;
for(var i=0;i<len;i++){
if(document.forms[0].chk[i].checked){
if (tag==0) {
chkId = chkId + document.forms[0].chk[i].value;
tag = 1;
} else {
chkId = chkId + ","+document.forms[0].chk[i].value;
}
}
}
} else {
if(document.forms[0].chk.checked){
chkId = document.forms[0].chk.value;
}
}
if (chkId=='') {
return;
}
return chkId;
}