Name

textDecoration — NN n/a IE 4 DOM n/a

Synopsis

Read/Write

Specifies additions to the text content of the element in the form of underlines, strikethroughs, overlines, and (in Navigator and CSS) blinking. You may specify more than one decoration style by supplying values in a space-delimited list. While Internet Explorer 4 accepts the blink value, it does not blink the text. Text decoration has an unusual parent-child relationship. Values are not inherited, but the effect of a decoration carries over to nested items. Therefore, unless otherwise overridden, an underlined P element underlines a nested B element within. Internet Explorer also includes properties for each decoration type.

Example

document.all.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

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.