http://blog.csdn.net/danny_xcz/archive/2005/12/23/559820.aspx

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

 DECMD_BOLD =                      5000;
 OLECMDEXECOPT_DODEFAULT =         0;
function button1_onclick() {
  DHTMLEdit1.ExecCommand(DECMD_BOLD,OLECMDEXECOPT_DODEFAULT);
}

function button2_onclick() {
  DHTMLEdit1.DocumentHTML = "The test paragraph";
  //DHTMLEdit1.DocumentHTML = "<P align=center><FONT size=7><STRONG>Hello, World!</STRONG></FONT></P>";
}
// -->
</SCRIPT>


<P align=center>
<INPUT id=button1 name=button1 type=button value=Bold LANGUAGE=javascript onclick="return button1_onclick()">
&nbsp;&nbsp;
<INPUT id=button2 name=button2 type=button value=Set LANGUAGE=javascript onclick="return button2_onclick()">
</P>

<P align=center>
<OBJECT classid="clsid:2D360200-FFF5-11d1-8D03-00A0C959BC0A" id=DHTMLEdit1
  height=400 width=500 VIEWASTEXT>
</OBJECT>
</P>

 

Posted on 2005-12-23 21:26  古代  阅读(476)  评论(0编辑  收藏  举报