Rendering HTML inside textarea

后端 未结 7 2020
孤独总比滥情好
孤独总比滥情好 2020-11-22 01:34

I need to be able to render some HTML tags inside a textarea (namely , , , ) but textareas only interpret their content as text. Is

7条回答
  •  日久生厌
    2020-11-22 02:14

    An addendum to this. You can use character entities (such as changing

    to <div>) and it will render in the textarea. But when it is saved, the value of the textarea is the text as rendered. So you don't need to de-encode. I just tested this across browsers (ie back to 11).

提交回复
热议问题