Closed Bug 150825 Opened 22 years ago Closed 22 years ago

<img> tag: the "alt" parameter does not work as it should

Categories

(SeaMonkey :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 25537

People

(Reporter: ppetrescu, Assigned: mpt)

Details

Normally, the alt parameter is used for two things:

1) to display a message when a browser can't/doesn't load an image
2) to display a message when hovering over an image with your mouse

The second one does not work in Mozilla and I think it's a very important thing
to have. I use it mostly for help when clicking an image button.
Example:

<a href="http://www.host.com/">
  <img alt="help about this image" src=/images/image.gif border=0>
</a>

The text "help about this image" should be displayed when hovering over this
image with your mouse, but it doesn't.

A workaround could be the following, but it's messier than the default
implementation.

<script>
function showtip(current,e,text) {
	if (document.all || document.getElementById)
		current.title=text;
}
function hidetip() {
	if (document.layers)
		document.tooltip.visibility="hidden";
}
</script>

<a href="http://www.host.com/" onMouseover="showtip(this,event,'help about this
image')" onMouseout="hidetip()">
  <img src="images/test.gif" border=0>
</a>
W3C specs say that "alt" is "alternative text" for images which can't be shown.

The "title" tag should do what you want.

This should be dup of bug 25537.
Yep, you want the title tag if you want the browser to display the title.

*** This bug has been marked as a duplicate of 25537 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
verified
Status: RESOLVED → VERIFIED
Component: User Interface Design → Browser-General
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.