<HTML>
<HEAD>
<TITLE> html编辑器教程 </TITLE>
<script language="javascript">
<!--
function init()
{
olEditor.document.open();
olEditor.document.write ("<div><i>HTML</i><b>编</b><font color= red>辑</font><u>器</u></div>");
olEditor.document.close();
olEditor.document.designMode="on";//加上这个普通的iframe就可以变成一个在线编辑器了
}
function InsertDate(date)
{
olEditor.focus();
olEditor.document.selection.createRange().pasteHTML(date);
olEditor.focus();
}
// -->
</script>
</HEAD>
<BODY onload="init()">
<FORM METHOD=POST ACTION="" name="form1">
<input type="text" name="myInsertDate" value="被插入数据" size="60"/>
<input type="button" value="将数据插入编辑器中的光标位置" onclick="InsertDate (document.all.myInsertDate.value)"><br/>
<input type="hidden" name = "content">
<iframe id="olEditor" width="100%" height="400" SCROLLING ="yes"></iframe><br/>
<INPUT TYPE="button" value="提交" onclick="form1.content.value=olEditor.document.body.innerText;form1.submit();">
</FORM>
</BODY>
</HTML>
<HEAD>
<TITLE> html编辑器教程 </TITLE>
<script language="javascript">
<!--
function init()
{
olEditor.document.open();
olEditor.document.write ("<div><i>HTML</i><b>编</b><font color= red>辑</font><u>器</u></div>");
olEditor.document.close();
olEditor.document.designMode="on";//加上这个普通的iframe就可以变成一个在线编辑器了
}
function InsertDate(date)
{
olEditor.focus();
olEditor.document.selection.createRange().pasteHTML(date);
olEditor.focus();
}
// -->
</script>
</HEAD>
<BODY onload="init()">
<FORM METHOD=POST ACTION="" name="form1">
<input type="text" name="myInsertDate" value="被插入数据" size="60"/>
<input type="button" value="将数据插入编辑器中的光标位置" onclick="InsertDate (document.all.myInsertDate.value)"><br/>
<input type="hidden" name = "content">
<iframe id="olEditor" width="100%" height="400" SCROLLING ="yes"></iframe><br/>
<INPUT TYPE="button" value="提交" onclick="form1.content.value=olEditor.document.body.innerText;form1.submit();">
</FORM>
</BODY>
</HTML>