Je veux seulement TD (test 1) de changement de classe (jaune). Comment faire uniquement TD (test 1) Changer de couleur (pas une ligne entière).
p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table class="table">
<thead>
<tr>
<th nowrap>TGL</th>
<th>CEK</th>
<th>TITEL</th>
<th>VAL</th>
</tr>
</thead>
<tbody>
<tr>
<td>01.12.19</td>
<td nowrap><input type='checkbox' name='cek' /></td>
<td nowrap>Test 1</td>
<td nowrap>1</td>
</tr>
</tbody>
</table>3 Réponses :
Vous pouvez essayer le code ci-dessous.
p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <table class="table" > <thead> <tr> <th nowrap>TGL</th> <th>CEK</th> <th>TITEL</th> <th>VAL</th> </tr> </thead> <tbody> <tr> <td>01.12.19</td> <td nowrap><input type='checkbox' name='cek' /></td> <td nowrap>Test 1</td> <td nowrap>1</td> </tr> </tbody> </table>
Utiliser p> parent () code> avec suivant () code>. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table class="table">
<thead>
<tr>
<th nowrap>TGL</th>
<th>CEK</th>
<th>TITEL</th>
<th>VAL</th>
</tr>
</thead>
<tbody>
<tr>
<td>01.12.19</td>
<td nowrap><input type='checkbox' name='cek' /></td>
<td nowrap>Test 1</td>
<td nowrap>1</td>
</tr>
</tbody>
</table>
Vous pouvez faire quelque chose ci-dessous strong> p> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table class="table" >
<thead>
<tr>
<th nowrap>TGL</th>
<th>CEK</th>
<th>TITEL</th>
<th>VAL</th>
</tr>
</thead>
<tbody>
<tr>
<td>01.12.19</td>
<td nowrap><input type='checkbox' name='cek' /></td>
<td nowrap>Test 1</td>
<td nowrap>1</td>
</tr>
</tbody>
</table>
Essayez
le plus proche ('td') code> au lieu dele plus proche ('tr') code>