Javascript question...
How do I change the backgound IMAGE using javascript?
(not bgColor)
Web Development
How do I change the backgound IMAGE using javascript?
(not bgColor)
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.
Sort by Trending