Click to See Complete Forum and Search --> : Row colour abstraction


kopite
03-30-2003, 05:38 AM
Hi

I am trying to abstract the background colour of a row.

e.g. ....rows[i].style.backgroundColor;

I am able to set a new colour but not able to abstract the current colour.

What am I doing wrong here?

Thanks in advance.

kopite
03-30-2003, 09:09 AM
Thanks, that works, but... it is before setting the new colour that I want to get the existing backgroundcolor. Unfortunately the colour of the row is set by a stylesheet

e.g.

<tr class="colourclass">

So how can I extract from the row the value - when it is a stylesheet that applies the colour ?

kopite
03-31-2003, 06:47 AM
Thanks, that is going to be v useful.

But, how do I extract what classname the row is using.

e.g. <tr class="colourclass">

Secondly, how do I establish which styleSheet the class resides as opposed to looping through the entire collection?

cheers

kopite
03-31-2003, 08:07 AM
Hmmm, but how do I get the className from a particular row, I have tried using these variations but to no avail...

e.g.
document.databody.rows[i].className;

document.getElementById(document.databody.rows[3].id).className;

It is return nothing ! :confused:

kopite
03-31-2003, 12:57 PM
This works

[form].elements[i].parentNode.parentNode.className

but it is probably a little unwise as it relies on only row elements existing in the form.

Any other suggestions?