Hey there! I've got this super simple code that does the job of changing the background color of a selected cell in a table to red. It's pretty awesome and works like a charm.
Here's the CSS:
.fixture-table td.team.on {
background-color: red;
}
And here's the JS:
$(document).on('ready', function() {
// change the color to red on table when clicked
$('td').click( function() {
$(this).toggleClass('on');
});
});
So, what I'm trying to achieve now is when the cell is clicked once, change it to red. If clicked again, change it to yellow. And then if clicked once more, remove the background color altogether. Essentially, I want to have three different states for the cell.
Thanks a bunch!