show html output in textarea instead of HTML code

蓝咒 提交于 2019-12-06 09:29:47

So to convert the the html code to a formated html you need to do:

$('resultDiv').append($('<div/>').html($('.txtArea').val()+"<br>");

here's an example that use div with contentEditable set to true.

It sounds like you're asking how to take some HTML and display its rendered result in your document.

That's exactly what the innerHTML property does.
Simply pick a DOM element to display the result in, and set its innerHTML to the HTML to display.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!