개요
- rowspan checkbox 선택시 병합되어있는 행의 체크박스도 모두 체크 된다
코드
<table border=1>
<tr>
<td rowspan="2">
<input type="checkbox" name="xxx" value="1" onclick="combat(this)"> 1 rows
</td>
<td>
<input type="checkbox" name="2" value="2" id="check2">row 2
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="3" value="3" id="check3">row 3
</td>
</tr>
</table>
<script>
function combat(checkbox) {
var check2 = document.getElementById("check2");
var check3 = document.getElementById("check3");
check2.checked = checkbox.checked;
check3.checked = checkbox.checked;
}
</script>
1 rows | row 2 |
row 3 |
반응형
댓글