Possible Duplicate:
Convert tags to html entities
I am building a snippets area to a friend’s site, and i need to know how to convert html tags to normal text so the page will show the tags.
Like here in the code:
<img>
so the tag will be seen and not become to a normal html tag,
And all this using javascript or jQuery.
What I got now is something like that:
<pre><code>THE USERS CODE</code></pre>
and it still hide the html tags and make them active.
thx 🙂
You could use
SOURCE: http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/