document.ids.whiteSpace

JavaScript 1.2+ Nav4+ Syntax

document.ids.idName.whiteSpace

Description

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

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

Example

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

Listing 7.137 Set the whiteSpace Property
 <html> <script> <!--Hide //Create a style sheet id that defines whitespace document.ids.NOPRE.whiteSpace = "normal"; //Hide End ---> </script> <p><pre>This line used to PRE tag to format whitespace.</pre></p> <p id=NOPRE>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.