白衣染霜花
function matchFun(obj) { var num = 0; var table1=document.getElementById(obj); var rows=table1.rows; for(var i=1;i<rows.length;i++){ for(var j=0;j<rows[i].cells.length;j++) { var str = rows[i].cells(j).innerHTML; if(str=="YES"){ num+=1; } } } if(num!=3){ alert("error!") } }列1列2YESNOYESNOYESNO点击