Forum Moderators: open
(edited by: justinen at 9:35 pm (utc) on April 9, 2002)
In fact document.write("hello") works in nearly every browser anywhere (not in the <TD> sections of some of the older browsers). But if you have a function something() {code} and the function is called before the script loads you will get an error. So it is best to make sure the code is high on the page.
And, as pcguru333 said the validator is likely looking for scripts to be in the head section. The validator is not checking the script for errors. But since this is a rollover script i am wondering if it would not in fact give an error if somebody had not downloaded the whole page before having their pointer over whatever is suppose to rollover?
I believe that the alt command is to display text on the page if images are turned off or don't download for whatever reason. End-users that have their PC setup to read the page hear the alt text read to describe the image.
The fact that the tooltip displays the same as the alt attribute is a bug/feature in some browsers.
Alt text should only appear in place of images providing those using text-only browsers, or simply surfing with images turned-off, a description of the intended image.
Those of us surfing using the Opera browser are already aware of this, as Opera, correctly, does not display the alt-text unless we disable images (keystroke "G" off/on).
The title tag should be used when tool-tips are desired. One neat thing I only recently noticed with Opera is that the displayed "tooltips" (title tag) do not time-out as with MSIE. The "tooltip" will remain visible as long as the cursor is hovering over the active element.