Jacklovely

导航

 
 1 <!DOCTYPE html>
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 5     <title>剪切板</title>
 6     
 7     <script type="text/javascript">
 8         onload = function () {
 9             btn.onclick = function () {
10                 var value = location.href;
11                 //clipboardData.setData("text", value),"text"不能改,value是复制的值。
12                 window.clipboardData.setData("text", value);
13             }
14         }
15     </script>
16 </head>
17 <body>
18     <input type="button" name="name" value="点击复制网址"  id="btn"/>
19 </body>
20 </html>

 

posted on 2016-04-08 10:53  Jacklovely  阅读(171)  评论(0编辑  收藏  举报