document.ids.backgroundImage
JavaScript 1.2+ Nav4+ Syntax
document.ids.idName.backgroundImage
Description
The backgroundImage property specifies the background image of an element as associated with the ID called idName.
Example
The code in Listing 7.106 makes the image logo.gif the background for the header text.
Listing 7.106 Setting the Background Image with the backgroundImage Property
<html> <script> <!-- Hide //Create a style sheet id that uses an image as a background document.ids.BGI.backgroundImage = "logo.gif"; //Hide End ---> </script> <h2 id=BGI>Look at my background image!</h2> </html> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.