Instead of using actual less than and greater than signs to enclose tags, use “& lt;” and/or “& gt;” (with no space in between the ampersand and the lt or gt). This way, they’ll show up as the less than and greater than signs on the page but won’t be parsed by the browser as actual code.
For example: & lt;a href=”link”>click& lt;/a>
So, here I just used & lt; for the opening of the tag but used a regular greater than sign to close the tag.
March 12th, 2007 at 1:42 am
use a comment tag like /*comment */
March 15th, 2007 at 11:19 pm
replace the input box with a large text box
March 17th, 2007 at 3:09 am
To display the code without executing it, you must replace that html tags. Take a look at this message:
March 19th, 2007 at 3:27 am
Instead of using actual less than and greater than signs to enclose tags, use “& lt;” and/or “& gt;” (with no space in between the ampersand and the lt or gt). This way, they’ll show up as the less than and greater than signs on the page but won’t be parsed by the browser as actual code.
For example: & lt;a href=”link”>click& lt;/a>
So, here I just used & lt; for the opening of the tag but used a regular greater than sign to close the tag.
March 21st, 2007 at 6:34 am
Wrap the code in the tag
blah
The first two answers of commenting won’t work as they simply hide the code from view, rather than stopping the browser from parsing the code.