아래의 코드에서 귀하의 전문 지식이 필요합니다. 체크 박스를 체크하고 클릭 버튼을 삭제하는 경우JavaScript : 체크 박스가 선택된 상태에서 모든 그리드 행을 숨기려면 버튼 클릭
<html>
<head>
<script>
function delrow() {
document.getElementById("db_grid_row1").style.display = 'none';
document.getElementById("db_grid_row2").style.display = 'none';
document.getElementById("db_grid_row3").style.display = 'none';
document.getElementById("db_grid_row4").style.display = 'none';
}
</script>
</head>
<body>
<form action="rowhide_action.php" method="post" name="save_form">
<input type="button" value="Delete" onClick="delrow();"></input>
<table border="1">
<thead>
<tr>
<th>#</th>
<th>Databases</th>
</tr>
</thead>
<tbody id="db_grid">
<tr id="db_grid_row1">
<td><input type="checkbox" name="cbox[]" value="1" ></input></td>
<td><input type="text" name="db[]" value="Oracle"></input></td>
<td><input type="hidden" name="modeflag[]" value="S" ></input></td>
</tr>
<tr id="db_grid_row2">
<td><input type="checkbox" name="cbox[]" value="1"></input></td>
<td><input type="text" name="db[]" value="MySQL"></input></td>
<td><input type="hidden" name="modeflag[]" value="S"></input></td>
</tr>
<tr id="db_grid_row3">
<td><input type="checkbox" name="cbox[]" value="1"></td>
<td><input type="text" name="db[]" value="Cassandra"></input></td>
<td><input type="hidden" name="modeflag[]" value="S"></input></td>
</tr>
<tr id="db_grid_row4">
<td><input type="checkbox" name="cbox[]" value="1"></input></td>
<td><input type="text" name="db[]" value="Mongo"> </input></td>
<td><input type="hidden" name="modeflag[]" value="S"></input></td>
</tr>
</tbody>
</table>
</br>
<input type="submit" value="Save"></input></br></br>
</form>
</body>
</html>
, 나는 (1) 행이 가지고있는 체크 박스를 숨겨 싶어요. (2) 숨김 행의 요소 modeflag [] value = "D"변경
도와주세요. 미리 감사드립니다. jQuery로
수 당신 jquery, 또는 순수한 js를 사용합니까? – webkit
JS 또는 Jquery가 괜찮습니다. –