チェックボックス付きのシンプルなテーブルがあります。チェックすると、行の色を変更する必要があります。
<tr height="35">
<td><input type="checkbox" ></td>
<td>Name</td>
<td>Surname</td>
</tr>
現時点では私はそれをします
jQuery('input[type="checkbox"]').click(function(){
jQuery(this).parent().parent().css('background-color', 'red');
});
しかし、.parent().parent()
これは良い考えではないと思います...また、背景を切り替える方法はありますか?たぶん、チェックした後、どういうわけかアリを変更しますか?