0

Is there any way that I could display HTML snippets in HTML page using textarea??

the following code is work

<textarea readonly='true'>
    <h1>Hello World</h1>
    <p>This is some text</p>
</textarea>

But when I put <textarea> tag in textarea is not work

<textarea readonly='true'>
        <textarea arows="4" cols="50">Hello World</textarea>
</textarea>

any idea to Display textarea snippets in textarea tag??

Thank you very much

Demo: https://jsfiddle.net/ga0bfpue/

MaryAnn
  • 95
  • 1
  • 8
  • Does this answer your question? [printing "" using html](https://stackoverflow.com/questions/3505047/printing-html-using-html) – SuperStormer Feb 22 '21 at 03:11
  • 1
    You should escape the [html entities](https://www.w3schools.com/html/html_entities.asp): `<textarea arows="4" cols="50">Hello World</textarea>` – Hao Wu Feb 22 '21 at 03:12

0 Answers0