473,320 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Style all children elements

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
1 1794
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rostov | last post by:
I've got a script where I'm trying to toggle the visibility of a div node by a click on an image that is the sibling of the div. So I've got this HTML: <div> <img...
7
by: Philip Herlihy | last post by:
If I'm reading my reference books correctly, I should be able to pick out cells in a table by combining a <col> selector with a class selector, like this: col#thisid td.thisclass {color: red; }...
4
by: feanor | last post by:
I need to select children checkboxes when selecting the parent one. This is my function: function SelectChildrens(checkbox_name){ form = document.forms; Sname = checkbox_name.split("-"); for...
6
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
17
by: eric.nave | last post by:
What is the correct way to find all the form elements in a particular div? I'd like to be able to loop through them and disable them. For example: <form> <div id="div1"> <input type=text...
0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
18
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to...
1
by: =?Utf-8?B?SmltSGVhdmV5?= | last post by:
If I create a <divand specify that I want the font-size to be 1.2em for instance, why do the <asp:controls not follow this rule if they are contained within the <divstatement? How/what do I need...
3
by: Arndt Jonasson | last post by:
Let's say we have a schema (maybe expressed in XML Schema, but not necessarily so), that allows this instance document: <top> <txt>This is text</txt> <books> <book>Tarzan</book> <book>Harry...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.