Style all children elements

N

noon

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,
 
N

noon

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top