document.ids.textDecoration

JavaScript 1.2+ Nav4+ Syntax

document.ids.idName.textDecoration

Description

The textDecoration property specifies the type of decoration that is added to text as associated with the ID called idName.

There are four types of values that are valid for the textDecoration property: underline, line-through, blink, and none.

Example

Listing 7.134 uses the textDecoration property to put a line through a line of text.

Listing 7.134 Set the textDecoration Property

<html>

<script>
<!-- Hide

//Create a style sheet id that defines the text decoration
document.ids.CROSSOUT.textDecoration = "line-through";

//Hide End --->
</script>

<p id=CROSSOUT>This text is crossed out.</p>

</html>
							
						

Get Pure JavaScript 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.