document.tags.whiteSpace

JavaScript 1.2+ Nav4+ Syntax

document.tags.tagName.whiteSpace

Description

The whiteSpace property specifies how whitespace should be handled within an element. Using dot notation, the property can be associated with the tag called tagName.

There are two types of values that are valid for the whiteSpace property: normal and pre.

Example

Listing 7.195 uses the whiteSpace property to make whitespace collapsed within the text element.

Listing 7.195 Set the whiteSpace Property
<html>

<script>
<!-- Hide

//Create a style sheet tag that defines whitespace
document.tags.B.whiteSpace = "normal";

//Hide End --->
</script>
							 <p><pre>This line used to PRE tag to format whitespace.</pre></p> <p><b>This line should have ...

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.