The title PropertyThe 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
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.
|