Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I change the Background color of a page from a JavaScript function?

0 views
Skip to first unread message

Tony Olsen

unread,
Nov 15, 2001, 5:09:02 PM11/15/01
to
I tried:

document.Body.bgcolor = "#FF00FF";
document.Body.bgcolor = "FF00FF";
document.TitleText.style.color = RGBString;
document.TitleText.style.color = "red";
BodyDiv.bgcolor.value = "red";
BodyDiv.backgroundcolor = "#" + RGBString;
Body.bgcolor = "darkgreen";
document.bgcolor = "red";
document.Body.style = "color : red";

and many other combinations, but nothing works. In fact, some combinations
managed to make my IE 6.0 crash.

Does anyone know how to do this? More specifically, has anyone succesfully
done this before?

Thanks in advance,

Tony Olsen
Fer...@Myself.Com


Mc Kiernan, Daniel Kian

unread,
Nov 15, 2001, 6:16:17 PM11/15/01
to
On 15-Nov-2001, "Tony Olsen" <Tony....@worldnet.att.net> wrote:

> I tried:
>
> document.Body.bgcolor = "#FF00FF";
> document.Body.bgcolor = "FF00FF";
> document.TitleText.style.color = RGBString;
> document.TitleText.style.color = "red";
> BodyDiv.bgcolor.value = "red";
> BodyDiv.backgroundcolor = "#" + RGBString;
> Body.bgcolor = "darkgreen";
> document.bgcolor = "red";
> document.Body.style = "color : red";
>
> and many other combinations, but nothing works.

document.bgColor = "#FF0000" ;

> In fact, some
> combinations managed to make my IE 6.0 crash.

Which?

> Does anyone know how to do this?

So it would seem.

> Does anyone know how to do this? More specifically, has anyone
> succesfully done this before?

Many, many, many times.

BTW, please ask Javascript questions in the appropriate group, which this is
not.

0 new messages