HTML Question

racketboy

Established Member
OK, here's what I want to do:

I want to have a table with about 5 columns and 16 rows.

Each table cell will have a checkbox and a corresponding description.

But I want the background color of the cell to change when that cell's checkbox it either checked or unchecked.

Is there a way to do this?
 
Well I've got it to the point of changing the color to blue when you click on the checkbox, but I don't know how to change it back to white if you click it again (uncheck it)
 

Attachments

  • test.htm
    1.5 KB · Views: 107
  • test.htm
    1.5 KB · Views: 97
  • test.htm
    1.5 KB · Views: 101
Maybe add a function that checks against a value in an array to see whether a cell has already been clicked or not? I think you might be able to do it with the addEventListener function as well, but I'm not sure how compatible that is.
 
Nasty hack alert! Nasty hack alert! Still, it works. :huh
 

Attachments

  • test2.html
    1.8 KB · Views: 127
  • test2.html
    1.8 KB · Views: 98
  • test2.html
    1.8 KB · Views: 99
Back
Top