Discussion Locked

Javascript question...

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do I change the backgound IMAGE using javascript?

(not bgColor)

1 reply

by paul dost

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. ). 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.

This discussion is closed to new replies.