How to change the background color of a row in a table?
Hi
I am trying to change the background color of a row within a table when the mouse is over that row.
I want to do that on all the tables in my site.
I found this code and tried to use it but it is not working
- $(document).ready(function() {
- //this code create the hover effect over the row's in every table
- $('table tr').hover(function() {
- $(this).addClass('tr_hover');
- }, function() {
- $(this).removeClass('tr_hover');
- });
- });
I have this css class
- .tr_hover {
- background-color: #FFFF99;
- }