how to show <html> in textarea
In textarea, I load text from database and then show in textarea. I have a problem, textarea not show <
and >
. It has been changed开发者_如何转开发 to < and > .
<textarea>>html></textarea>
in textarea , change to . I want to show <html>
, how to make it ?
Escape the &
by using &
.
Change this:
<textarea><html></textarea>
To this:
<textarea>&lt;html&gt;</textarea>
If you're using PHP you can automatically do this with htmlspecialchars()
.
You may also want to use the Entity Number. It depends on the page character set. For ISO-8859-1 you would do "<(semicolon)" and ">(semicolon)". replace the "(semicolon)" part with ; ... This just shows that this page supports it too :)
For a complete list view HTML ISO-8859-1 Reference
精彩评论