DHTML Lab - DHTML Diner - IE4: Toggling TITLE Value Display | 2 | WebReference

DHTML Lab - DHTML Diner - IE4: Toggling TITLE Value Display | 2

home / experts / dhtml / diner / titletog
DHTML Diner Logo

This is an Internet Explorer 4 technique. The in-page examples will only work in Explorer 4 Windows and Explorer 4 Macintosh.

Toggling the Display of TITLE Values

The Standard
The HTML4 specification defines the TITLE= attribute in this way:

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

Unlike the TITLE element, which provides information about an entire document and may only appear once, the title attribute may annotate any number of elements.

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.

HTML4 Spec

Tags with TITLE= Attribute
The HTML4 spec defines TITLE= as an attribute of all tags, except for:

STYLE, and

The rationale is, of course, that all tags that display and/or format something on the user screen can have a TITLE= attribute. That is, all tags that can be moused over. It foresees that any future new tags with this behavior should have the attribute.

TITLE= Syntax
TITLE=, like ALT=, takes a string value:

<TAG TITLE="a text string goes here"></TAG>

Browser Support

Navigator 4

Navigator does not presently support the TITLE= attribute. In all probability, the next version will.

Explorer 4

The Explorer SDK documentation is fairly confusing. The TITLE= attribute is declared to be an attribute of all tags, including the ones omitted by the HTML4 spec. But they are not always documented to be properties of the tag-as-object, as one would expect.

For example, in the page devoted to the <STYLE> tag, TITLE= is defined as a possible attribute. When discussing TITLE=, in the properties section, STYLE is not listed as a possible container. There are about a dozen such inconsistencies.

Limited testing has brought these results:

  • Explorer supports the HTML4 standard use of TITLE=
  • The use of TITLE= is extended to include tags excluded by the HTML4 spec
  • The TITLE= attribute is read/write for all tags through the title property of all tag objects
  • In non-HTML4-standard tags, the use of TITLE= does not produce a tool tip, just a read/write attribute for authors to store advisory information for other uses.

There, that about exhausts the subject! On this page, as you may have noticed if using Explorer 4, there are many pop-up tool tips created by the TITLE= attribute. You may have found them useful, or simply an annoyance. In the left column, we have included a button that toggles the use of tool tips. Click it once, the tool tips stop popping up. Click it again, they resume their default behavior. How do we do this? With a short script discussed on the next page.

Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Sept 14, 1998
Revised: Sept 14, 1998

URL: http://www.webreference.com/dhtml/diner/titletog/titletog2.html