CSS background color changed by JS

liunx

Guest
I'm using CSS to set the properties on my "body" tag for background-image, background-color, and the text and links colors. It works well for my entire site except for one page where I wish to be able to change the background color using JavaScript. I killed the CSS background by putting 'style="background-image:url();"' in my "body" tag, but the JavaScript to change the background color no longer works when I include the CSS. Help?style="background:red none;"
or with JS document.body.style.background="red none";Thank you, Fang, you've gotten me closer. It works well in FireFox, Netscape 7, and IE, but not in Netscape 4 and only badly in Opera.

I'm curious why "document.bgColor" gets killed by the CSS.Netscape 4 and Opera 6 have poor support for css. Newer versions should have no problems with this snippet of code.Netscape 4 and Opera 6 have poor support for css. Newer versions should have no problems with this snippet of code.

I'm running Opera 7.23. Hmmm.

At least 98% of internet users' DNA is identical to that of chimpanzees.

I think you've just offended 98% of chimpanzees. :DIt works in Opera 7.02 7.54 and 8
You are probably the only user using 7.23 ;)
Try them separately:
document.body.style.backgroundImage="none";
document.body.style.backgroundColor="red";
 
Back
Top