Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML tag that causes other tags to be rendered as plain text [duplicate]

Tags:

People also ask

How do I display HTML tags as plain text in HTML?

You can show HTML tags as plain text in HTML on a website or webpage by replacing < with &lt; or &60; and > with &gt; or &62; on each HTML tag that you want to be visible. Ordinarily, HTML tags are not visible to the reader on the browser.

Which of the following tag makes the plain text?

The <plaintext> HTML element 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. Warning: Do not use this element.

What is XMP tag in HTML?

Summary. The <xmp> HTML element renders text between the start and end tags without interpreting the HTML in between and using a monospaced font.


I'd like to add an area to a page where all of the dynamic content is rendered as plain text instead of markup. For example:

  <myMagicTag>
      <b>Hello</b> World
  </myMagicTag>

I want the <b> tag to show up as just text and not as a bold directive. I'd rather not have to write the code to convert every "<" to an "&lt;".

I know that <textarea> will do it, but it has other undesirable side effects like adding scroll bars.

Does myMagicTag exist?

Edit: A jQuery or javascript function that does this would also be ok. Can't do it server-side, unfortunately.