下面這些都是對選中內容的操作:
<input type=button value=剪下 onclick=document.execCommand('Cut')>
<input type=button value=拷貝 onclick=document.execCommand('Copy')>
<input type=button value=粘貼 onclick=document.execCommand('Paste')>
<input type=button value=撤消 onclick=document.execCommand('Undo')>
<input type=button value=重做 onclick=document.execCommand('Redo') id=button2 name=button2>
<input>
<input type=button value=刪除 onclick=document.execCommand('Delete')>
<input type=button value=黑體 onclick=document.execCommand('Bold')>
<input type=button value=斜體 onclick=document.execCommand('Italic')>
<input type=button value=底線 onclick=document.execCommand('Underline')>
<input type=button value=停止 onclick=document.execCommand('stop')>
<input type=button value=儲存 onclick=document.execCommand('SaveAs')>
<input type=button value=另存新檔 onclick=document.execCommand('Saveas',false,'c:\\test.htm')>
<input type=button value=字型 onclick=document.execCommand('FontName',false,fn)>
<input type=button value=字型大小 onclick=document.execCommand('FontSize',false,fs)>
<input type=button value=重新整理 onclick=document.execCommand('refresh',false,0)>
UnBookmark 從當前選中區中刪除全部書籤。
Underline 切換當前選中區的底線顯示與否。
Undo 撤消。
Unlink 從當前選中區中刪除全部超級連結。
Unselect 清除當前選中區的選中狀態。
SelectAll 選中整個文檔。
JustifyCenter 將當前選中區在所在格式化塊置中。
JustifyLeft 將當前選中區所在格式化塊靠左對齊。
JustifyRight 將當前選中區所在格式化塊靠右對齊。
轉自:http://blog.sina.com.cn/s/blog_4efce4d10100cimp.html