[thelist] Changing a picture's alt title
Aylard JA (James)
jaylard at equilon.com
Wed May 24 13:48:43 2000
Michael Galvin wrote:
> No, wait. Is there any way of changing the alt title when I change the
> image? The 'before' image has an alt of "move left", and I want to change
> it to "move right".
You can do this with IE5+ like so:
document.images['name'].src = "image.gif"
document.images['name'].alt = "move right"
Comments:
* In theory, this should work in IE4 also, but there is a bug that prevents
the alt-text tooltip from being dynamically updated (if you check the "alt"
property via script, you will get the correct value; however, the mouseover
tooltip does not reflect this).
* This *won't* work in Netscape 4.x and earlier, which does not understand
the "alt" property (it returns "undefined").
* Netscape 6 *does* recognize the property, although the latest Mozilla
builds (on which Netscape 6 is based) do not display any tooltips;
presumably this will change by the release version.
hth,
James Aylard
jaylard@equilon.com