General discussion

Locked

Javascript question...

By kes_dude_2002 ·
How do I change the backgound IMAGE using javascript?

(not bgColor)

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Background Image

by Paul Dost In reply to Javascript question...

You can't directly change the background image in javascript as there is no document.background attribute (although there is a layer.background). One way that looks like it should work (I haven't tried it myself) is to create a CSS style and apply it to the body (e.g. <BODY Class="myBodyStyle"&gt. Styles in JavaScript have both a backgroundColor and backgroundImage.

I've gleaned this from Netscape's JavaScript Client Reference which is available from their DevEdge site.

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums