<!--兼容FF、IE7-->
<div style="height:300px; width:600px; border:1px solid #000000">
<iframe id="HtmlEditor" src="" frameborder="0" marginheight="0" marginwidth="0" style="width:100%; height:100%;">d</iframe>
<br><br>
</div>
<script type="text/javascript">
window.onload = function () {
var f = document.getElementById("HtmlEditor");
var html = '<HEAD></HEAD><BODY><div></div></BODY>';
f.contentWindow.document.open("text/html", "replace");
f.contentWindow.document.write(html);
f.contentWindow.document.close();
f.contentWindow.document.designMode = "on";
}
</script>
Html编辑器基础
最新推荐文章于 2025-05-20 11:27:53 发布
本文介绍了一个使用HTML和JavaScript实现的简单编辑器示例。该编辑器通过iframe元素提供富文本编辑功能,并利用JavaScript设置初始文档结构,开启设计模式以便进行编辑。
2341

被折叠的 条评论
为什么被折叠?



