The Bartlett pear is a background image of a div. Click it to set it to a lemon background image.

Fruit is Good.

In Netscape, getting an element's background image is not as simple as getting other property values.

When accessing a background image in Netscape, you get a full url path with slashes, but in IE you get the style value. Click here to see the results of getting the background image value of fruitDiv with getStyle (after it's been changed by clicking on it).

What is worse: in Netscape, hexadecimal color values are always converted to rgb. Let's say you used setStyle('myDiv','backgroundColor','#0000FF'); to change myDiv's background color to #0000FF. Using getStyle would return a value of rgb(0,0,255). Click the red div below to see what I mean.

By now, you may be wondering why you need to get an element's style value. When you get to the toggleStyle lesson, you will see why this is useful. There are ways of dealing with Netscape's annoying behavior, and I will explain them in that lesson.