I was wondering why Firefox doesn't show tooltips when you use the
alt attribute in
img tags like IE does. Turns out IE should not be displaying alt messages in tooltips, the
title attribute is designed for that.
But don't stop using the
alt attribute, thats required for accessibility. So your best bet is to include both an alt attribute, and a title attribute in your img tags if you want a tooltip. IE will show the title attribute value in the tooltip.
People say that displaying alt text in a tooltip is a bug in IE, but I would rather call it a feature!
I'd say it's a bug. As you say, 'alt' is alternate text for the image. Since IE is displaying the image, the alternate text is irrelevant. If you have image display turned off, then the alt text should be listed where the image would ordinarily be.
Since IE will correctly display the 'title', rather than the 'alt' if both are present, it's a bug that is pretty irrelevant (i.e. if you code it right, IE works right), so I don't know that anyone will complain too much.
ALT and TITLE serve different purposes. ALT is replacement test. TITLE is supplementary text. Replacement text might be something like, "Picture of our founder, Jane Public, standing in front of a bridge." Supplementary text might be something like, "Our founder, Jane Public." This becomes more noticeable if you have a headline or company logo in graphical form. You should repeat the headline or name in ALT for people using text browsers or with images turned off... but it doesn't serve any purpose to display a tooltip with that information. So in that case, you're best off putting text in ALT and using a blank TITLE.
Writing text for the intended purposes results in a page that works cross-browser and is more accessible than picking one attribute over the other.