Rendering HTML inside textarea

后端 未结 7 1849
孤独总比滥情好
孤独总比滥情好 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 02:09

    With an editable div you can use the method document.execCommand (more details) to easily provide the support for the tags you specified and for some other functionality..

    #text {
        width : 500px;
    	min-height : 100px;
    	border : 2px solid;
    }

提交回复
热议问题