五分钟内反应回复,平均十分钟解决任何IT技术问题,按难度跟工作量收费!

jquery点击复制文字功能的案例

admin |浏览589次
检举|收藏|2017/06/14 10:56

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jquery点击复制,兼容所有游览器</title>

    <script type="text/javascript" src="/skin/js/jquery-1.8.0.min.js"></script>
 
            


<script src="/skin/js/swfobject.js" type="text/javascript"></script>
<script language="JavaScript">
function Alert(msg) {
    alert(msg);
}
function thisMovie(movieName) {
     if (navigator.appName.indexOf("Microsoft") != -1) {   
         return window[movieName];   
     } else {   
         return document[movieName];   
     }   
 }
function copyFun(ID) {
    thisMovie(ID[0]).getASVars($("#"+ID[1]).attr('value'));
}
</script>
</head>
<body>

 <span>账户名:</span><input type="text" id="bank-username" readonly value="333333" class="text4" />
     <em class="copy" for="bank-username">
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="62" height="23" id="copy-bankuser" align="top">
                <param name="allowScriptAccess" value="always" />
                <param name="movie" value="/skin/js/copy.swf?movieID=copy-bankuser&inputID=bank-username" />
                <param name="quality" value="high" />
                <param name="wmode" value="transparent">
                <param name="bgcolor" value="#ffffff" />
                <param name="scale" value="noscale" /><!-- FLASH原始像素显示-->
                <embed src="/skin/js/copy.swf?movieID=copy-bankuser&inputID=bank-username" width="62" height="23" name="copy-bankuser" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" />
            </object>
      </em>

</body>



</html>




附上完整的案例代码


jquery点击复制功能.zip


全部回答(0)
 加载中...