<html>
<body>
<center>
<div unselectable="on" align="center" style="height:360; width:400; background-color:menu; border:outset menu">
<br>
<div id="foo" contenteditable align="left" style="height:250; width:350; background-color:white;font-face:Arial; padding:2; border:inset powderblue; scrollbar-base-color:powderblue; overflow-auto;">
</div>
<input type="button" value="粗体" unselectable="on" οnclick='document.execCommand("Bold"); foo.focus();'>
<input type="button" value="斜体" unselectable="on" οnclick='document.execCommand("Italic"); foo.focus();'>
<input type="button" value="下划线" unselectable="on" οnclick='document.execCommand("Underline"); foo.focus();'>
<input type=button value="黑体" οnclick=document.execCommand('FontName',false,'黑体')>
<input type=button value="9号字" οnclick=document.execCommand('FontSize',false,9)>
<input type=button value="红色字" οnclick=document.execCommand('ForeColor',false,'#ff0000')>
<br>
<input type=button value="撤消" οnclick=document.execCommand('Undo')>
<input type=button value="重做" οnclick=document.execCommand('Redo') id=button2 name=button2>
<input type=button value="删除" οnclick=document.execCommand('Delete')>
<input type=button value="剪切" οnclick=document.execCommand('Cut')>
<input type=button value="拷贝" οnclick=document.execCommand('Copy')>
<input type=button value="粘贴" οnclick=document.execCommand('Paste')>
<br>
<input type=button value="刷新" οnclick=document.execCommand('refresh',false,0)>
<input type=button value="停止" οnclick=document.execCommand('stop')>
<input type=button value="保存" οnclick=document.execCommand('SaveAs')>
<input type=button value="另存为" οnclick=document.execCommand('Saveas',false,'c:\test.htm')>
</div>
</center>
</body>
</html>
</td>
</tr>
</table>
简易editor
最新推荐文章于 2024-06-24 09:45:50 发布