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.
<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.<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 the text/plain
MIME-type.<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.font-family
style with the monospace
generic value.This element has no other attributes than the global attributes common to all elements.
This element implements the HTMLElement
interface.
Implementation note: In Gecko 1.9.2 and before, Firefox implements the interface HTMLSpanElement
for this element.
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | 4
|
Yes | Yes | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | 4 | Yes | Yes | Yes |
<pre>
and <code>
elements, which should be used instead.<listing>
and <xmp>
elements, which are both obsolete elements similar to <plaintext>
.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext