すべての行にボタンがある HTML テーブルがあります。ここでの目的は、ボタンがクリックされたときに、行全体の背景色が変更されることです。コードは次のとおりです。
<table>
<tr>
<td>Value1</td>
<td>Value2</td>
<td>
<input type="button" value="press" onclick="myFunction(this)" />
</td>
</tr>
<tr>
<td>Value3</td>
<td>Value4</td>
<td>
<input type="button" value="press" onclick="myFunction(this)" />
</td>
</tr>
</table>
<script type="text/javascript">
function myFunction(e) {
//change the background color of the row
}
</script>
これで私を助けてもらえますか?ありがとう!