Im trying to target elements inside of a table with the class ‘.income_table’. I want to toggle/untoggle a highlighted background color each time a element gets clicked. This isn’t working:
<script>
$(document).ready(function(){
$(".income_table tr").click(function () {
$(this).toggleClass("toggled_tr");
});
});
</script>
Is there a problem with my code?
Works for me : http://jsfiddle.net/mplungjan/xBzPW/