Javascript Reference
Categories: STYLE

javascript STYLE backgroundImage

@March 15, 2008, 1:22 a.m.
backgroundImageFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 2  

Read/Write  

URL of the background image of the element. If you also set a backgroundColor, the image overlays the color. Transparent pixels of the image allow the color to show through.

 
Example
 
document.getElementById("navbar").style.backgroundImage =
"url(images/navVisited.jpg)";
 
Value

Any complete or relative URL to an image file in CSS URL format: url(filePath).

 
Default

None.


Powered by Linode.