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

Style all children elements

P: n/a
I am using XPath to select certain cells from a table that match some
criteria. From there, I am applying styles to the entire row using
'item.parentNode.style'. What I want to do is style the text color
for the entire row. Well, of course 'item.parentNode.style.color =
'red'' on the table row doesn't work. I know with css a contextual
selector of 'table tr td {style:red;}' would work. However, I don't
know how to accomplish something similar in javascript. Is there no
other way to do it than looping over 'item.parentNode' and applying
styles to each child (table cell)? And if this is the only way, how
could I reference the children of 'item.parentNode'?

Appreciated,
Jan 16 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jan 16, 10:23 am, noon <Nun...@gmail.comwrote:
I am using XPath to select certain cells from a table that match some
criteria. From there, I am applying styles to the entire row using
'item.parentNode.style'. What I want to do is style the text color
for the entire row. Well, of course 'item.parentNode.style.color =
'red'' on the table row doesn't work. I know with css a contextual
selector of 'table tr td {style:red;}' would work. However, I don't
know how to accomplish something similar in javascript. Is there no
other way to do it than looping over 'item.parentNode' and applying
styles to each child (table cell)? And if this is the only way, how
could I reference the children of 'item.parentNode'?

Appreciated,
I solved this issue. Disregard
Jan 16 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.