Using html tag in textarea

Dear, I’m trying to insert html tags such as <ol><li> in my readonly textarea

the code looks like this:

<textarea readonly>
<ol><li>Today is tuesday</li>
<li>Today is not a holiday</li>
</ol>
</textarea>

However, all html tags in textarea do not turn into as aspected.

Can I know is there any way to make it work???

Thank you!

A textarea can only contain text, not HTML elements. You can’t display an HTML list inside a textarea.

If you want to show HTML markup in a textarea, you should escape all ‘<’ characters with &#38;lt;. For consistency’s sake, you may also escape ‘>’ characters with &#38;gt;.

May? Try should, Tommy.

It’s not strictly necessary, Dan. It’s a good idea, nevertheless.

Habit, Tommy. :slight_smile: