| Depr. | Empty | Version |
|---|---|---|
| Yes | Yes | N/A |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Partial | Partial | Partial | Partial | Partial |
Syntax
Description
The
plaintext element was originally intended to instruct
the browser to ignore any formatting or HTML markup , such that
<p> would appear in screen as
<p> rather than actually create a new paragraph. It
is deprecated and is probably best forgotten entirely.
The example shown would render as follows:

Example
plaintext being
used to demonstrate a code sample:
<p>The markup for this is:</p>
<plaintext><h1>Main heading goes here</h1>
<p>First paragraph goes here</p>
<h2>Sub-heading goes here</h2></plaintext>.
</body>These two lines are left here for a purpose! See compatibility section
</html>
Use this for…
Anything goes.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial |
The
plaintext element has an optional closing tag, but in
the browsers tested, the closing </plaintext> tag was
ignored completely - effectively every HTML tag after the opening
<plaintext> was ignored and therefore not parsed by the
browser. By placing this non-standard element on a page, you kill off
anything that follows. Note in the screenshot, even the closing
</body> and </html> tags, which came after the
closing </plaintext> tag, are rendered on screen. You should
use the pre element
instead for the purposes of rendering carriage returns and white space,
and convert any HTML delimiters (the < and
> parts of the opening and closing tags) to HTML
entities.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.