Jump to content

Both alt="text" title="text". Any negative implications?


blogsmith

Recommended Posts

alt is not intended for tooltip at all. That's a mistake with Internet Explorer.Alt: An attribute used to display some text in the place of the image if the image was not loaded.Title: An attribute used to show some text in the tooltip above any element when you pass the mouse over it.Never use alt with the intention of showing tooltip text.Here's the correct usage of alt and title:<img src="house.jpg" alt="[image of a small white house]" title="This is my house!">

Link to comment
Share on other sites

I use [title] whenever I have an onclick handler.
How's that?
<div title="Click Me!" onclick="alert('You clicked me!');">Hey</div>

Link to comment
Share on other sites

Yes, that will work.
I'm aware of that. My question was more in line with why would you use that on every element that has an onclick handler.
Link to comment
Share on other sites

'alt' abreviation for alternate, as in alternet text. title is pretty self explanatory.although in firefox i'm sure alt brings up a tooltip :S might be wrong.:)

Link to comment
Share on other sites

'alt' abreviation for alternate, as in alternet text. title is pretty self explanatory.although in firefox i'm sure alt brings up a tooltip :S might be wrong.:)
Only Internet Explorer does it. I use Firefox and Opera all the time and neither of them do that.
Link to comment
Share on other sites

why would you use [a title] on every element that has an onclick handler.
Well, maybe not every one. :) Remember I'm mostly into web apps, so if a button label or icon might be misunderstood (murphy's law) I'll use a title. But if I've got a spreadsheet sort of thing, then, no, I don't have a title for each cell. "Enter data here. Enter data here . . ." That would be frustrating.When I'm feeling really clever, if one part of the app turns another part off, then I'll null the corresponding title. (Yeah, my scripts can be long.) Basically, I try to use best practice for any good gui. I actually imitate Firefox a lot, since it's always right here.I've never actually written a kill_all_titles function, but I've considered it. Problem is, I'd want a restore_all_titles function, and I've never taken the time to work out that part.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...