I am seeking assistance with a table I have created, and I want to implement a feature where the background color of cells with prices will change when clicked (using addClass(on)
). The goal is to also change the background color of surrounding cells (using addClass(off)
) while ensuring that cells with text and different colors remain unaffected.
In addition, I would like to retrieve the ID of the row to which the clicked cell belongs. Below is an example structure of a row:
<tr class="taksit" id="tek">
<td><b>Tek Çekim</b></td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
<td><?=$sontutar?> TL</td>
</tr>
I have attempted various methods suggested here but have not been successful in implementing this functionality. Any suggestions on how to achieve this desired outcome?