How to show literal HTML script in a web page?

You'll need to encode the angle brackets etc in order to show this on the page.

You can do this manually in html as:

<a href="#">test</a>

Where:

&lt; = <

&gt; = >

For other characters here's a table of character codes: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references


You need to HTML-escape your text, as you can easily tell if you look at the HTML source of this very page:

<div class="post-text">
    <p>I have some HTML that I would like to make it appear like the code option here</p>

    <pre><code>&lt;a href="#"&gt;test&lt;/a&gt;
    </code></pre>

    <p>How can I do it?</p>
</div>            

Tags:

Html