HTML tag text content is displayed correctly without parsing

Source: Internet
Author: User

to make an HTML tag appear normally on an HTML page without being parsed:

The simplest way there are 3 kinds of

1, the contents of the XMP tag package, the code is as follows:

  

1 < XMP >< a >xianshi xmp</a></XMP>

  2, the contents of the package with textarea tag, the code is as follows:

  

< Pre >< textarea >< a >woshi textarea</a></textarea></ Pre >

 3, escaped < as &lt; , > for&gt;

< Pre > &lta&gtwoshi Pre&lt/a&gt</pre>

  In addition to the above methods, the H5 can be used <script type="text/html"> or<script type="text/template">来实现,代码如下:

  

<Scripttype= "text/html"ID= "js_texthtml"style= "Display:block;">        <a>wo shi type="text/html"</a>    </Script>

  In other words, in Vue, put the code string directly into the {{}}, but note that the label ends with an escape character such as ' <script>var a= ' bb <\/script> ' (without adding the words will be an error)

HTML tag text content is displayed correctly without parsing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.