Quote (eagl3s1ght @ 11 Sep 2012 23:14)
If people don't care, do you really think they'll care if you write "can anybody help? thanks"?
For me, it would go from "Maybe I'll help him later" to "What an impatient kid, he can try harder to get some help".
Your problem is that you didn't google the issue first. I just did and found out the issue with the first result.
This in a function will also refer to the function itself, not the element which calls the function. So, we call the function with a reference to the element itself (this).
http://jsfiddle.net/CxDXj/thanks
also what i wanted to do after is to change the color depending of what key the user presses:
ex:
if he has his mouse on cell 1 and press b -> color = blue
if he has his mouse on cell 1 and press r -> color = red
if he has his mouse on cell 2 and press b -> color = blue
and so on
how would i program this? i would need an if statement in my function? or create 2 functions depending on what he inputs?
thanks