Regarding my previous post :
My html
<table class="table table-bordered table-condensed table-striped"> <thead> <tr> <th>Col 1</th> <th>Col 2</th> <th>Col 3</th> </tr> </thead> <tbody> <tr> <td><strong>Data 1</strong></td> <td>Data 2</td> <td>Data 3</td> </tr> <tr> <td><strong>Data 1</strong></td> <td>Data 2</td> <td>Data 3</td> </tr> <tr> <td><strong>Data 1</strong></td> <td>Data 2</td> <td>Data 3</td> </tr> </tbody> </table>
JQuery
$(document).ready(function(){ $('table.table-striped tr').on('click', function () { $(this).find('td').css('background-color', '#ff0000');
I am trying to toggle the color of a string using through the click event. Any idea if this is possible with a custom css selector?
source share