用javascript 复制文本框中的内容到剪切板

< script language = " javascript " >   
function  setImg(no) 

var t=document.getElementById(no); 
t.select(); 
window.clipboardData.setData(
'text',t.createTextRange().text); 
alert(
"复制成功!");
}
 
</ script >


< td width = " 387 " >
      
< input id = " js "  name = " img_url "  type = " text "  class = " s1 "  size = " 80 "  value = " javascript复制文本框 " />      </ td >
    
< td width = " 277 " >< label >
      
< input type = " submit "  name = " Submit "  value = " 复制地址 "  onclick = " js " />
    
</ label ></ td >
 

你可能感兴趣的:(JavaScript,function,url,Class)