如果我有包括一些HTML代码,我怎么能写一个JavaScript函数来显示HTML输出,而不是HTML代码本身就是一个文本区域,例如:显示HTML输出
<textarea id="mytextarea">
<table border=1><tr><td>cellone</td>td>celltwo</td></tr></table
</textarea>
<input type=button onclick="HTMLoutput();"/>
<script>
HTMLoutput()
{
//Code to show html output instead of html code in textarea
}
</script>
我怎样才能做到这一点?在HTMLoutput()中写入的建议代码是什么?
可能重复[如何显示textarea内的HTML格式?](http://stackoverflow.com/questions/7785607/how-can-i-show-html-formatting-inside-a-textarea) – DevlshOne