How to display HTML tags as text

You must use use the escaped version. For example < becomes &lt; (no quotes) and & becomes &amp;.

You should be able to find a full list of transformations.

An example snippet:

&lt;a href="http://google.com"&gt;Google&lt;/a&gt;

is the escaped version of:

<a href="http://google.com">Google</a>

Edit:

The standard’s list of entities: http://www.w3.org/TR/html4/sgml/entities.html

A Wikipedia artcile on it: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Leave a Comment