Text decoration is often confused with text style. In word processors you will commonly see italic and bold in the same menu as underline and strike-through. In the context of a web browser they are separated into fontStyle and text decoration.
The following decorations can be applied:
blink
line-through
overline
underline
none
You can apply several of these decorations as long as they are space-separated in the string being assigned.
To restore text decoration to its default state simply assign an empty string, "". It is also likely that the value "none" will cancel the text decoration too, at least on the MSIE browser.
There are individual properties for each of these styles that you can use if you prefer. Those properties are controlled with a Boolean primitive value.
Setting the properties to the value true will add that decoration to the text block.
Setting the style.textDecorationNone property to true will automatically set the others to false and cancel the text decoration effect.
Prev | Home | Next |
style.textAutospace | Up | style.textDecorationBlink |
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. |