Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.

It just seems like a bad word choice.. or am I missing something?

share|improve this question

closed as primarily opinion-based by Mathew Foscarini, MichaelT, Kilian Foth, Dan Pichelman, Robert Harvey Aug 8 '13 at 18:03

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
What's your suggestion then? And while I am commenting, care to explain how this is on topic? –  Oded Aug 7 '13 at 12:41
    
@Oded I was merely checking to see if I'm missing anything... because my brain cannot accept a no reason for such a word choice. Maybe it is my assumption that the words 'title' and 'tip' mean/refer to largely different things (such as title of this post, and tooltip when I hover over time/date). –  laggingreflex Aug 7 '13 at 13:10

4 Answers 4

up vote 21 down vote accepted

The W3C HTML standard on the title attribute:

This attribute offers advisory information about the element for which it is set...

Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object). Audio user agents may speak the title information in a similar context. For example, setting the attribute on a link allows user agents (visual and non-visual) to tell users about the nature of the linked resource:

...some text...
Here's a photo of 
<A href="http://someplace.com/neatstuff.gif" title="Me scuba diving">
   me scuba diving last summer
</A>
...some more text...

The title attribute is a not a tooltip. It is "advisory information about the element" that particular user agents may choose to render as a tooltip.

The title attribute is a mechanism to attach a text description directly onto an element; the particular UI implications of this information are implementation-dependent. The only requirement imposed by the WHATWG HTML standard about the visual representation of title's "advisory information" is that the information should be viewable somehow:

User agents should inform the user when elements have advisory information, otherwise the information would not be discoverable.

share|improve this answer
    
Do any browsers inform the user when elements have the title attribute, other than by displaying the tooltip? Because displaying the tooltip requires specific user action, an action that people aren’t terribly likely to do unless they already know there is a title attribute. –  KRyan Aug 7 '13 at 16:27
2  
@KRyan, speech-based browsers may inform the user about the availability of extra information when they encounter a title attribute and read its value on user request. –  Jukka K. Korpela Aug 7 '13 at 17:17
    

Why? It's a historical artifact from the early days of the internet. It originated with the HTML 1.2 draft (1993) and was integrated with the HTML 2.0 specification. It's purpose was to indicate the title of the document--as simple as that.

Deeper dive:

In the beginning, the purpose of HTML was to provide a markup language that could be used for books and documents--not our modern understanding of web pages.

Back in those days, they had this great tag called "Title"

<TITLE> Moby Dick</TITLE>

The purpose of the TITLE tag was to declare the title of the document that you were viewing.

However, when you provided a link, you could add a title to that as well, so that the user knew what the next document was:

<A TITLE="Moby Dick" HREF="...">Next Book</A>

After that point, the title attribute moved to the other tags. Later, when you added a "title" to a picture, the browsers chose not to display that immediately on the webpage, but to add it to the tooltip. As it moved to other elements, it just became the tooltip.

share|improve this answer
    
HTML 1.2 Specifications –  Richard Aug 7 '13 at 13:10
1  
There is no documented connection between the title element and the title attribute, beyond the name. Regarding the reference in the comment, there was never any HTML 1.2 specification. The linked document is an Internet-draft that expired long ago. –  Jukka K. Korpela Aug 7 '13 at 17:19
2  
@JukkaK.Korpela Fair enough, it's only the 1.2 Draft rather than specifications. However, the "title" element and attribute are historical items. The question is "Why?" The answer is "History". Also, the link between the attribute and the tag is very direct TITLE. OPTIONAL. This is informational only. If present the value of this field should equal the value of the TITLE of the document whose address is given by the HREF attribute. (from the 1.2 "draft") –  Richard Aug 7 '13 at 17:39
    
Also, the HTML 2.0 specification for the Anchor attribute reflects the earlier drafts quite clearly. –  Richard Aug 7 '13 at 17:41

I think the tooltip is an implementation decision of browsers, not the intended used expressed in the specification.

I'm inclined to believe that the title attribute was intended for screen readers other and DOM parsers.

share|improve this answer

There is no good reason for the choice of the attribute name title. The name has been fixed now, anyway, so the choice is practically irrelevant, except in teaching.

Historically, title was first defined for links only, and it was seen as specifying an “advisory title” for the linked document – a bit extravagant formulation, which means that it is an external title, i.e. a title (name) of the linked document as provided by the linking document.

Although the title attribute is still popular in some circles, it is being replaced by “CSS tooltips”, which provide much better rendering and control over it – and do not (normally) use a title attribute at all.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.