Click to return to the HTML Help home page    
Web Workshop  |  DHTML, HTML & CSS  |  HTML Help

To insert the JavaScript code


Microsoft Corporation

Updated June 10, 1999

Insert the following JavaScript code between the <HEAD> start and end tags of an HTML file.

function functionOn(idVar){
idVar.style.attribute="value";
}

function functionOff(idVar){
idVar.style.attribute="value";
}

Where functionOn is the name of the JavaScript function that changes the style when a user moves their cursor over the section, and functionOff is the script that is called when the user moves their cursor off the section. attribute="value" represents a style attribute that changes when the script is called. idVar is the ID of the element.

Example

The following is the JavaScript code used for the dynamic "Go" link in the HTML Help documentation:

function liteGo(spNo){
spNo.style.background="#cc0033";
spNo.style.color="#FFFFFF";
}

function liteOff(spNo){
spNo.style.background="transparent";
spNo.style.color="#000000";
}

Note


next step Update your style sheet to reflect the new section
 


Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.