HOME >
DHTML サンプル集 > チェックボックスで選択したテーブル選択行の背景色を変える
|
チェックボックスで選択したテーブル選択行の背景色を変える
サンプルソース
<script language="Javascript">
function Click_Sub(ix) {
if (document.all.y1(ix).checked==true) {
document.all.x1(ix).style.backgroundColor='#cccccc'
} else {
document.all.x1(ix).style.backgroundColor='#ffffff'
}
}
</script>
<table border=1 width=100%>
<tr id="x1"><td><input id="y1" type="checkbox" onclick="Click_Sub(0)">チェック<td>テキスト1
<tr id="x1"><td><input id="y1" type="checkbox" onclick="Click_Sub(1)">チェック<td>テキスト1
</table>
|
サンプル
関連する内容
|
スポンサードリンク
|