The title Property


The title Property

The title property is a W3C property that adds some explanatory data to HTML elements. Browsers use the title property as a tooltip (those small windows that pop up with descriptive text when the mouse rests on an object). You can find the support for this property in Table 5.59.

Table 5.59. The title Property

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

title

     

x

   

x

x

x

x

 

Read/Write

 

Type: String

Here's an example that adds a tooltip to some text in a <P> element:

(Listing 05-23.html on the web site)
 <HTML>      <HEAD>          <TITLE>              Using the title Property          </TITLE>      </HEAD>      <BODY>          <H1>Using the title Property</H1>          <P NAME="text1" ID="text1">              Here's the text.          </P>          <SCRIPT LANGUAGE="JavaScript">              <!--  document.all.text1.title = "Here's a tooltip!"  // -->          </SCRIPT>      </BODY>  </HTML> 

You can see the results in Figure 5.17, where the tooltip is displaying its text.

Figure 5.17. Using the title properties.

graphics/05fig17.gif



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net