Rendering HTML inside textarea

后端 未结 7 1845
孤独总比滥情好
孤独总比滥情好 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:23

    I have the same problem but in reverse, and the following solution. I want to put html from a div in a textarea (so I can edit some reactions on my website; I want to have the textarea in the same location.)

    To put the content of this div in a textarea I use:

    var content = $('#msg500').text();
    $('#msg500').wrapInner('');
    
    
    here some html tags.

提交回复
热议问题