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 520159 of <plaintext>

  • Revision slug: Web/HTML/Element/plaintext
  • Revision title: <plaintext>
  • Revision id: 520159
  • Created:
  • Creator: charmander
  • Is current revision? No
  • Comment Minor spelling and grammar fixes. The rest still needs to be cleaned up.

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 implemented neither 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.
{{HTMLRef}}

Revision Source

<div>
 {{Obsolete_header}}</div>
<h2 id="Summary">Summary</h2>
<p>The <em>HTML Plaintext Element</em> (<code>&lt;plaintext&gt;</code>) 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 implemented neither 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 <code>text/plain</code> <a href="/en-US/docs/Properly_Configuring_Server_MIME_Types" title="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 '<code>&lt;</code>' and '<code>&gt;</code>' 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-US/docs/Web/CSS">CSS</a> style using <code>monospace</code> 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 href="/en-US/docs/Web/HTML/Global_attributes" rel="internal" title="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>
 {{HTMLRef}}</div>
Revert to this revision