How to display HTML tags as plain text ?


I want to display to the user a plain HTML snippet, but whenever I'm trying its automatically being rendered as HTML without the tags.

I want to display the following,

<p>This is a paragraph </p>

But its rendering

This is a paragraph

How to display the plain code?

1 Answer

4 years ago by

Replace the < with &lt and > with &gt

&ltp&gt This is a paragraph  &lt/p&gt
4 years ago by Divya