Closed Bug 235387 Opened 20 years ago Closed 20 years ago

when i use setAttribute to change the backgroud color of an object, it becomes #0000e0 instead of transparent

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 227072

People

(Reporter: crez, Assigned: bugzilla)

References

()

Details

User-Agent:       
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

try looking at the page http://test.channelweb.it/bug/setattribute.html which i
published to report this bug.

Starting color of the a table row is #cccccc;
the button below should set the background color to trasparent.
After changing the color, it becomes #0000e0 instead of transparent !!!

the code is:
document.getElementById('id1').setAttribute('bgcolor', 'transparent');



Reproducible: Always
Steps to Reproduce:
1. create a <tr> with id="id1" (actually it seems the same with other html obj)
2. try to document.getElementById('id1').setAttribute('bgcolor', 'transparent');
3. the background color becomes #0000e0

Actual Results:  
the background color becomes #0000e0

Expected Results:  
the background color shoul becomes transparent

setAttribute('bgcolor') is being used more and more, so i think that solving
this bug is quite important
(In reply to comment #0)

Probably a duplicate of Bug 227072.

> setAttribute('bgcolor') is being used more and more, so i think that solving
> this bug is quite important

I have no numbers to back this up so it's all opinion but aren't most people
moving towards CSS, rather than towards deprecated attributes like bgcolor?

i.e. document.getElementById('id1').style.backgroundColor = 'transparent';


*** This bug has been marked as a duplicate of 227072 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.