Buy online at www.borders.com

It's Not Just Help. . .

So How Does It Work?

HTML Topics & Templates
CSS
DHTML
Project File (.hhp)

Contents File (.hhc)

Merging Modular Files

Accelerating Links

Distribution & Installation



HTML Help Resources on the Web


Change Color on Mouse Click Recipe

Purpose

This recipe makes the affected text change color when the user clicks on it. You can use the similar code in the Show/hide text recipe to make this text change color when the user mouses over it.

Sample

click the affectedText to see it turn red

Call within the element

previousText

<SPAN onClick="this.style.color='desiredHue'">
affectedText
</SPAN>

followingText

where

 

previousText

is the text that appears on the Web page right before the affected text;

 

desiredHue

is the color the text turns, specified as a reserved color name or as an RGB value; (See Color values in Chapter 4, “Doing It in Style: CSS (Cascading Style Sheets.”)

 

affectedText

is the text that changes color when the mouse moves over it;

 

followingText

is the text that appears on the Web page right after the affected text.