HTML在线编辑器实际上是什么
其实有好几种实现方式,目前用得最多、兼容性最好的还是iframe方式。
<iframe src="" frameborder="0"></iframe>
只有这个空iframe是不行的,还要用Javascript把它设成可编辑:
iframe.contentWindow.document.designMode = "on";
iframe.contentWindow.document.contentEditable = true;
换而言之,HTML在线编辑器就是一个可编辑的iframe。