https://www.wuisou.com/s/qgpk/845588112.html https://www.wuisou.com/s/jb/77292601.html https://www.wuisou.com/s/nygt/356490897.html https://www.wuisou.com/s/hnrp/404524403.html https://www.wuisou.com/s/xy/845922032.html https://www.wuisou.com/s/fcl/370682417.html https://www.wuisou.com/s/wzgw/577211489.html https://www.wuisou.com/s/jgwt/806991710.html https://www.wuisou.com/s/smd/176201864.html https://www.wuisou.com/s/dgj/760301438.html https://www.wuisou.com/s/rm/997214188.html https://www.wuisou.com/s/qp/98531543.html https://www.wuisou.com/s/nl/689720595.html https://www.wuisou.com/s/nzj/345459086.html https://www.wuisou.com/s/hnrp/168479435.html https://www.wuisou.com/s/smd/246781854.html https://www.wuisou.com/s/rwj/516057050.html https://www.wuisou.com/s/mbpl/253984414.html https://www.wuisou.com/s/nygt/89969494.html https://www.wuisou.com/s/qgpk/645341058.html https://www.wuisou.com/s/rd/452955814.html https://www.wuisou.com/s/stgg/73894108.html https://www.wuisou.com/s/nl/570464912.html https://www.wuisou.com/s/qly/434944877.html https://www.wuisou.com/s/lqhc/968101341.html https://www.wuisou.com/s/jgwt/220452397.html https://www.wuisou.com/s/pxf/772073564.html https://www.wuisou.com/s/hhjj/691203420.html https://www.wuisou.com/s/mbpl/124229471.html https://www.wuisou.com/s/qp/532418646.html https://www.wuisou.com/s/hrm/408200678.html https://www.wuisou.com/s/nl/655505358.html https://www.wuisou.com/s/jfz/437866735.html https://www.wuisou.com/s/wzgw/976254265.html https://www.wuisou.com/s/yx/85949330.html https://www.wuisou.com/s/lxgg/443736280.html https://www.wuisou.com/s/xy/18715071.html https://www.wuisou.com/s/qtqx/737905573.html https://www.wuisou.com/s/tpn/565334812.html https://www.wuisou.com/s/rwj/690265292.html https://www.wuisou.com/s/jcr/98387597.html https://www.wuisou.com/s/brjh/114791981.html https://www.wuisou.com/s/zz/876040021.html https://www.wuisou.com/s/tcfx/610007184.html https://www.wuisou.com/s/sj/163474468.html https://www.wuisou.com/s/xy/276614573.html https://www.wuisou.com/s/nl/22945304.html https://www.wuisou.com/s/zz/690258055.html https://www.wuisou.com/s/gwtj/352671847.html https://www.wuisou.com/s/nygt/345075827.html https://www.wuisou.com/s/qp/435448612.html https://www.wuisou.com/s/zz/229350405.html https://www.wuisou.com/s/tcfx/71414456.html https://www.wuisou.com/s/qgpk/509367461.html https://www.wuisou.com/s/jfz/815382406.html https://www.wuisou.com/s/yc/888603660.html https://www.wuisou.com/s/hhjj/148074244.html https://www.wuisou.com/s/qtqx/909521874.html https://www.wuisou.com/s/qly/272314514.html https://www.wuisou.com/s/fnn/895515574.html https://www.wuisou.com/s/wzgw/954835991.html https://www.wuisou.com/s/fnn/479232795.html https://www.wuisou.com/s/jb/586555406.html https://www.wuisou.com/s/lxgg/690077148.html https://www.wuisou.com/s/dgj/330831554.html https://www.wuisou.com/s/zz/229604925.html https://www.wuisou.com/s/nl/941987085.html https://www.wuisou.com/s/nwr/733757713.html https://www.wuisou.com/s/brjh/900942381.html https://www.wuisou.com/s/msg/282229255.html https://www.wuisou.com/s/jfz/172031429.html https://www.wuisou.com/s/nygt/215154078.html https://www.wuisou.com/s/hm/389371774.html https://www.wuisou.com/s/smd/191446913.html https://www.wuisou.com/s/mkfw/85640016.html https://www.wuisou.com/s/nygt/15478640.html https://www.wuisou.com/s/mkfw/568838715.html https://www.wuisou.com/s/lxgg/699376897.html https://www.wuisou.com/s/wg/537613895.html https://www.wuisou.com/s/fcl/463512527.html https://www.wuisou.com/s/hrm/183615005.html https://www.wuisou.com/s/rm/656020449.html https://www.wuisou.com/s/yc/286822089.html https://www.wuisou.com/s/qly/480601228.html https://www.wuisou.com/s/wg/218640988.html https://www.wuisou.com/s/rwj/639280595.html https://www.wuisou.com/s/jb/482665978.html https://www.wuisou.com/s/msg/798132101.html https://www.wuisou.com/s/msg/963740086.html https://www.wuisou.com/s/gwtj/487742232.html https://www.wuisou.com/s/jb/393503399.html https://www.wuisou.com/s/stgg/745577775.html https://www.wuisou.com/s/fcl/744100657.html https://www.wuisou.com/s/msg/396789116.html https://www.wuisou.com/s/msg/116348245.html https://www.wuisou.com/s/brjh/584689046.html https://www.wuisou.com/s/lqhc/766009324.html https://www.wuisou.com/s/stgg/475464168.html https://www.wuisou.com/s/msg/878084419.html https://www.wuisou.com/s/ny/873022077.html

点击按钮复制指定代码js网页特效

  • 内容
  • 相关

点击按钮复制指定代码,在网上搜索了几种,觉得比较好,记下以备查询

 

一、点击复制文本框内容的代码(1)

<script type="text/javascript"> 
    function jsCopy(){ 
        var e=document.getElementById("content");//对象是content 
        e.select(); //选择对象 
        document.execCommand("Copy"); //执行浏览器复制命令

       alert("已复制好,可贴粘。"); 
    } 
</script> 
<textarea cols="60" name="content" rows="2" id="content">www.qzpcw.com</textarea> 
<input type=button value="复制" onclick="jsCopy()">

二、点击复制文本框内容的代码(2)

<SCRIPT language=JavaScript> 
<!-- 
function MM_goToURL() { //v3.0 
var i, args=MM_goToURL.arguments; document.MM_returnValue = false; 
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); 
} 
function JM_cc(ob){ 
var obj=MM_findObj(ob); if (obj) { 
obj.select();js=obj.createTextRange();js.execCommand("Copy");} 
} 
function MM_findObj(n, d) { //v4.0 
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 
if(!x && document.getElementById) x=document.getElementById(n); return x; 
} 
//--> 
</SCRIPT> 
<FORM action="" method=post name=form1> 
<TEXTAREA cols=60 name=js_1 rows=2 wrap=VIRTUAL>www.qzpcw.com</textarea> 
</form> 
<INPUT name=Button onclick="JM_cc('js_1')" type=button value=复制>

三、点击复制文本框内容的代码(3)

<script> 
function oCopy(obj){ 
obj.select(); 
js=obj.createTextRange(); 
js.execCommand("Copy") 
} 
</script> 
<input onclick="oCopy(this)" value=www.qzpcw.com>

四、点击复制标题和地址的代码

<title>www.qzpcw.com</title> 
<input type="button" name="Submit" onClick='copyToClipBoard()' value="复制本页地址,传给QQ/MSN上的好友"> 
<script language="javascript"> 
   function copyToClipBoard(){ 
    var clipBoardContent=""; 
    clipBoardContent+=document.title; 
    clipBoardContent+=""; 
    clipBoardContent+=this.location.href; 
    window.clipboardData.setData("Text",clipBoardContent); 
    alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友"); 
} 
</script>

五、点击复制网址的代码

<script type="text/javascript"> 
function copyText(obj) 
{ 
var rng = document.body.createTextRange(); 
rng.moveToElementText(obj); 
rng.scrollIntoView(); 
rng.select(); 
rng.execCommand("Copy"); 
rng.collapse(false);

alert("复制成功,请粘贴到你的QQ/MSN上发送给你的好友。");   <!--这句根据需要加,可有可无-->

} 
</script> 
以下是代码片段:<br> 
<span id="tbid">http://www.qzpcw.com</span> 
[<a href="#" onclick="copyText(document.all.tbid)">点击复制</a>]<br> 
<span id="tbid1">http://www.qzpcw.com</span> 
[<a href="#" onclick="copyText(document.all.tbid1)">点击复制</a>]<br>

评论后还是无法显示下载地址?清理缓存-点我试试
热度:2192° 评分:8.7 发布时间: 2018年4月29日

本文标签:这篇文章木有标签

版权声明:若无特殊注明,本文皆为《小洋vier》原创,转载请保留文章出处。

本文链接:点击按钮复制指定代码js网页特效 - https://www.wuioo.com/post-1.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注