How to efficiently get color of element which has no background, but one of his parent has? For example this is 3 levels depth set:
- TOP1 is red
- TOP2 is green
- TOP3 doesn't have a background color defined, yet it is green.
I have no problem writing a function to iretate through parents and find backgroundColor property but I believe it's not really reliable and cross browserly would suck.
UPDATE
I may want to clarify why I want such a thing.
One of my cases: I am building sticky header for a table which will clone the first set of columns of a table and stick them(position: fixed) when user scrolls very wide table. So they can see the columns they are viewing.
Sometimes table has styles associated with it and columns have colors which may be inherited from table, it's container or actually anywhere. That's why I insist on using JavaScript solution on this.