Can I embed HTML formatting inside of a <textarea> tag?
If I have a textarea
block like so...
<textarea name="myTextArea" cols="100" rows="20" readonly=readonly>
.. text area content ...
</textarea>
How can I embed HTML formatted text inside this text block? If I can I had figured the following should work...
<textarea name="myTextArea" cols="100" rows="20" readonly=readonly>
<b>Hello how are you today?</b>
</textarea>
As an example. But that sentence does not show up as bold. Maybe I'm just trying to do something that can't be done?
Solution 1:
I am pretty sure the answer is no -- cannot do it with a textarea.
From the MDN docs:
The HTML <textarea> element represents a multi-line plain-text editing control.
- Permitted content Text
Solution 2:
Is not possible with
<textarea>
Use this:
<div contenteditable="true">
</div>