Availability: |
| ||||||||
Property/method value type: | Color value | ||||||||
JavaScript syntax: | - | myDocument.linkColor | |||||||
- | myDocument.linkColor = aColorValue | ||||||||
HTML syntax: | <BODY LINK="aColorValue"> | ||||||||
Argument list: | aColorValue | A hex color value or color name |
This value controls the text of active links in the document body. You should use the normal color values to define the required color.
This property is equivalent to the LINK attribute of the <BODY> HTML tag. This is the color that is used for as yet unvisited links.
Now that the style control facilities are more sophisticated, this tag attribute is likely to fall into disuse. On the other hand it does work consistently on both MSIE and Netscape where style sheet controls do not.
DOM level 1 deprecates this property in favor of the BODY.link property.
This property can only be changed in the <HEAD> section. You cannot modify it after the <BODY> has commenced loading.
On MSIE 5 for Macintosh, the color of the link remains set to its default color until a mouse rolls over it whereupon it changes to the value defined in the script. This is probably a bug.
Some suggested work arounds include using document.write() to output the <BODY> tag as the document is loaded. This might work for some applications although I have experienced significant problems with complex pages that are being built with document.write() calls. The problems seem to stem from the internal document structure being incomplete, and once the page is loaded, some object references crash the browser. This is particularly problematic with<OBJECT> tags in MSIE for Windows and because the <BODY> tag is so fundamental to a document, you may want to check that a page composed in this way really does work on all browsers and platforms.
Prev | Home | Next |
Document.layers[] | Up | Document.links[] |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |