17
Hi Rowdie,
The right way to show a tooltip is the title tag. The wrong way is the alt tag.
If you use the title tag:
1. It works in all browsers
2. You are in compliance with the W3C
3. Your code will validate
If you use the alt tag:
1. It only works in one browser
2. You are out of compliance with the W3C
3. Your code will validate as having alternate text for images, when you are really using it for something else.
The DHTML script you linked to is for people who want to change the color or the background color or add HTML inside of the tooltip to override how the tooltip would show normally in a user's browser. (adding a link to the wikipedia listing, for example). However, be aware that it will make your site not validate and be out of compliance again. Additionally, it won't provide information to text browsers or blind people with screen readers.
To simply display the tooltip all that is needed is the title attribute.
Let's say for example that I have a submit button on my form that is a picture of betty boop. The alt tag should be "submit" while the title tag should be "betty boop" or "picture of betty boop" or something similar.
HTH