Ok, picture this...


Each cell of the table has an id tag that has been manually set.

I use document.getElementById( targetID ); to hook the cell.

targetID is generated from a function that I have tried with lots of variants and it returns an ID within the range of 0,1 to 6,5 (bit like x and y cords. This part I know works but the problems start with trying to apply properties to the hooked element.

for example:

t = document.getElementById( targetID );
t.style.style.backgroundColor = "#FFFF66";
results in the following error in the console
"Uncaught TypeError: Cannot read property 'style' of null "

And this is using an example directly off the W3Schools site.

I get the same when I try to access or set the elements colour by its .className property.


Have I gone nuts or has JavaScript no dropped that method in favor of something else?

Does not matter if I try to put something in to that cell, the same error keeps on popping up.