View Full Version : document.all[i].style.backgroundImage not reading?

04-24-2006, 04:57 PM
:confused: hello

I cant read the backgroundImage property in ie. i am using:


but the property is just showing up blank. I can set it using:

document.all[i].style.backgroundImage= "url(image.jpg)"

i just cant read it?

any ideas?

04-24-2006, 07:19 PM
Read this: Migrate apps from Internet Explorer to Mozilla - MDC (http://developer.mozilla.org/en/docs/Migrate_apps_from_Internet_Explorer_to_Mozilla)

And this: http://www.quirksmode.org/dom/getstyles.html

04-25-2006, 10:56 AM
In other words, use id and document.getElementById(id) method instead of document.all[name].

And use currentStyle (for IE) / getComputedStyle (for Moz) to retreive an embeded or external CSS attribute's value (see the Kravitz's links)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum