document.classes.whiteSpace

JavaScript 1.2+ Nav4+ Syntax

document.classes.className.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 class called className. The definition can also specify a tag or the word all for tagName.

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

Example

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

Listing 7.93 Set the whiteSpace Property
 <html> <script> <!-- Hide //Create a style sheet class that defines white space document.classes.NOPRE.all.whiteSpace = "normal"; //Hide End ---> </script> ...

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.