Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 424693 of <plaintext>

  • Revision slug: Web/HTML/Element/plaintext
  • Revision title: <plaintext>
  • Revision id: 424693
  • Created:
  • Creator: tregagnon
  • Is current revision? No
  • Comment

Revision Content

{{ Obsolete_header() }}

Summary

The HTML Plaintext Element (<plaintext>) renders text following the start tag without interpreting the HTML. It doesn't have an end tag as everything following it is no more considered HTML

Note: Do not use this element. 
  • It is deprecated since HTML 2 and was neither implemented by all browsers, nor in a consistent way. Even more it is obsoleted in HTML 5 and may be rendered by conforming user-agents as the {{ HTMLElement("pre") }} element, which will interpret the internal html !
  • If the {{ HTMLElement("plaintext") }} element is the first element in the page (except for non-displayed element), do not use HTML at all. Configure your server to send your page with the text/plain MIME-type.
  • Instead use the {{ HTMLElement("pre") }} element or if semantically adequate the {{ HTMLElement("code") }} element, eventually escaping the HTML '<' and '>' so that they don't get interpreted.
  • A monospaced font can also be obtained on a simple {{ HTMLElement("div") }} element, by applying an adequate CSS style using monospace as the generic-font value in a {{ cssxref("font-family") }} property.

Attributes

This element has no other attributes than the global attributes, common to all elements.

DOM interface

This element implements the {{domxref('HTMLElement')}} interface.

Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the interface {{domxref('HTMLSpanElement')}} for this element.

See Also

  • The {{ HTMLElement("pre") }} and {{ HTMLElement("code") }} elements to be used instead.
  • The {{ HTMLElement("listing") }} and {{ HTMLElement("xmp") }} elements, similar to {{ HTMLElement("plaintext") }} but also obsolete.
{{ HTML:Element_Navigation() }}

Revision Source

<div>
  {{ Obsolete_header() }}</div>
<h2 id="Summary">Summary</h2>
<p>The <em>HTML Plaintext Element</em> (<span style="font-family: Courier New;">&lt;plaintext&gt;</span>) renders text following the start tag without interpreting the HTML. It doesn't have an end tag as everything following it is no more considered HTML</p>
<div class="note">
  <strong>Note: </strong>Do not use this element.&nbsp;
  <ul>
    <li>It is deprecated since HTML 2 and was neither implemented by all browsers, nor in a consistent way. Even more it is obsoleted in HTML 5 and may be rendered by conforming user-agents as the {{ HTMLElement("pre") }} element, which will interpret the internal html !</li>
    <li>If the {{ HTMLElement("plaintext") }} element is the first element in the page (except for non-displayed element), do not use HTML at all. Configure your server to send your page with the <span style="font-family: Courier New;">text/plain</span> <a href="/en/Properly_Configuring_Server_MIME_Types" title="en/Properly Configuring Server MIME Types">MIME-type</a>.</li>
    <li>Instead use the {{ HTMLElement("pre") }} element or if semantically adequate the {{ HTMLElement("code") }} element, eventually escaping the HTML '<span style="font-family: Courier New;">&lt;</span>' and '<span style="font-family: Courier New;">&gt;</span>' so that they don't get interpreted.</li>
    <li>A monospaced font can also be obtained on a simple {{ HTMLElement("div") }} element, by applying an adequate <a href="/en/CSS" title="en/CSS">CSS</a> style using <span style="font-family: Courier New;">monospace</span> as the generic-font value in a {{ cssxref("font-family") }} property.</li>
  </ul>
</div>
<h2 id="Attributes">Attributes</h2>
<p>This element has no other attributes than the <a class="new " href="/en-US/docs/Web/HTML/Global_attributes" rel="internal" title="en/HTML/global attributes">global attributes</a>, common to all elements.</p>
<h2 id="DOM_interface">DOM interface</h2>
<p>This element implements the {{domxref('HTMLElement')}} interface.</p>
<div class="note">
  <p><strong>Implementation note: </strong>up to Gecko 1.9.2 inclusive, Firefox implements the interface {{domxref('HTMLSpanElement')}} for this element.</p>
</div>
<h2 id="See_Also">See Also</h2>
<ul>
  <li>The {{ HTMLElement("pre") }} and {{ HTMLElement("code") }} elements to be used instead.</li>
  <li>The {{ HTMLElement("listing") }} and {{ HTMLElement("xmp") }} elements, similar to {{ HTMLElement("plaintext") }} but also obsolete.</li>
</ul>
<div>
  {{ HTML:Element_Navigation() }}</div>
Revert to this revision