By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,043 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,043 IT Pros & Developers. It's quick & easy.

TR background

P: n/a
I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.

someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)

thanks !
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gandalf wrote:
I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.
document.getElementById(TR_id).style.backgroundCol or="red"
>
someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)
document.getElementsByTagName('td')[x].style.backgroundColor="white"

document.getElementsByTagName('td')[x].parentNode.style.backgroundColor="green"
thanks !
Mick
Jun 27 '08 #2

P: n/a
On Apr 14, 9:50 pm, Gandalf <goldn...@gmail.comwrote:
I recently discovered that TR can have background property in simple
html and in CSS but when i tried to reach TR element through
javascript document.getElementById(TR_id).style.background or
document.getElementById(TR_id).background it doesn't work.

someone know how can I reach this property through javascript

p.s (in this case i can't use the td class name to reach a specific
row background like this :

if(document.getElementsByTagName('td')[x].headers=='class_'+z)
document.getElementsByTagName('td')[x].style.background=' '
)

thanks !
OK don't pay etention to this message TR can be reached by javascript
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.