1
網頁技術 / execCommand
« 於: 2009-03-09 11:44 »
執行這一段code, 可以把複製的文字代入fsrc
請問有什麼方法可以把文字直接代入fsrc而不使用focus(), <input .../>
請問有什麼方法可以把文字直接代入fsrc而不使用focus(), <input .../>
代碼: [選擇]
<script>
var temp;
function timer()
{
test();
t=setTimeout('timer()', 1000);
}
function test(){
tt.value="";
tt.focus()
document.execCommand('paste');
if (temp==tt.value){
}else{
fsrc=tt.value;
alert(fsrc);
temp=fsrc;
}
}
</script>
<body onload=timer()>
<input id=tt name=tt />