[RESOLVED] Going Nutz here with .getElementById
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.
results in the following error in the console
t = document.getElementById( targetID );
t.style.style.backgroundColor = "#FFFF66";
"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.
Does not matter if I try to put something in to that cell, the same error keeps on popping up.
Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
I laughed that hard I burst my colostomy bag... (\\.\ May03)
Life for some is like a car accident... Mine is like a motorway pile up...
Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)