Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
The HTML Plaintext Element (<plaintext>
) renders everything following the start tag as raw text, ignoring any following HTML. There is no closing tag, since everything after it is considered raw text.
Note: Do not use this element.
<plaintext>
is deprecated since HTML 2, and not all browsers implemented it. Browsers that did implement it didn't do so consistently.<plaintext>
is obsolete in HTML5; browsers that accept it may instead treat it as a<pre>
element that still interprets HTML within.- If
<plaintext>
is the first element on the page (other than any non-displayed elements, like<head>
), do not use HTML at all. Instead serve a text file with thetext/plain
MIME-type. - Instead of
<plaintext>
, use the<pre>
element or, if semantically accurate (such as for inline text), the<code>
element. Escape any<
,>
and&
characters, to prevent browsers inadvertently parsing content the element content as HTML. - A monospaced font can be applied to any HTML element via a CSS
font-family
style with themonospace
generic value.
Attributes
This element has no other attributes than the global attributes common to all elements.
DOM interface
This element implements the HTMLElement
interface.
Implementation note: In Gecko 1.9.2 and before, Firefox implements the interface HTMLSpanElement
for this element.
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
plaintext | Chrome Full support Yes | Edge Full support 12 | Firefox
Full support
4
| IE Full support Yes | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.
- See implementation notes.
- See implementation notes.
See also
- The
<pre>
and<code>
elements, which should be used instead. - The
<listing>
and<xmp>
elements, which are both obsolete elements similar to<plaintext>
.