欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

复制粘贴的js

程序员文章站 2022-05-14 22:20:47
...

<title></title>
<script language=Jscript>
function Exec(obj,cmd){
obj.select();document.execCommand(cmd)}
function Paste(obj){
obj.focus();document.execCommand('paste')}
function Exe(cmd){
document.execCommand(cmd)}
</script>
<form name=f1>
<input type=button value='拷贝' onclick=Exec(code,'Copy')>
<input type=button value='剪切' onclick=Exec(code,'Cut')>
<input type=button value='清空' onclick=Exec(code,'Delete')>
<textarea name=code rows="20">Input Code ...</textarea></form>
相关标签: HTML