Javascript Reference
Categories: STYLE

javascript STYLE textDecoration

@March 15, 2008, 1:22 a.m.
textDecorationFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 2  

Read/Write  

Specifies additions to the text content of the element in the form of underlines, strikethroughs, overlines, and (in Navigator and CSS) blinking. Browsers use this style attribute internally to assign by default underlines to a elements and strikethroughs to strike elements, so the default value varies with element type. You may specify more than one decoration style by supplying values in a space-delimited list. While browsers accept the (CSS optional) blink value, they (thankfully) do not cause the text to blink. Text decoration has an unusual parent-child relationship. Values are not inherited, but the effect of a decoration carries over to nested items in most cases. Therefore, unless otherwise overridden, an underlined p element underlines a nested b element within. Internet Explorer also includes Boolean properties for each decoration type.

 
Example
 
document.getElementById("emphasis").style.textDecoration = "underline";
 
Value

In addition to none, any of the following four constants (as a string): blink | line-through | overline | underline. Multiple values may be included in the string as a space-delimited list.

 
Default

Element and internal style sheet dependent.

Under moderation.
JasonRow - 2017-06-23

Powered by Linode.