HTML tag to prevent HTML tags to be executed?
This:
The html code for < is &lt;
Renders as:
The html code for < is <
The basic strategy is to escape the &
as &
In this case, you DON'T need to encode it. Try this one:
<xmp> html < < </xmp>
I'm not sure about cross browsers support, but works on IE7,FF3,Chrome3
You are going to have to do it manually.
Here you have the full encoding table. The most commonly used codes are:
Character Entity Number Entity Name Description
" " " quotation mark
' ' ' apostrophe (does not work in IE)
& & & ampersand
< < < less-than
> > > greater-than