2011/10/27

HTML entities in Textarea tag

Maybe this is obvious, but I just leaned it. See the example below,
<textarea>
techrecorder&reg;
</textarea>
I expected to see the '&reg;' but it gives me '®' So when the value of textara tag is presented by convering all of html entities code to the code result, for exmaple, '&lt;' to '<' and '&quot;' to '"'. So if you wanted to show html entities code in textarea, you have to escape &, for example,
<textarea>
techrecorder&amp;reg;
</textarea>

No comments:

Post a Comment