亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

JS實現(xiàn)移動端點擊按鈕復制文本內(nèi)容

 更新時間:2019年07月28日 10:29:15   作者:vue筆記  
本文通過實例代碼給大家介紹了移動端點擊按鈕復制文本內(nèi)容 ,代碼簡單易懂,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下

移動端點擊按鈕復制文本內(nèi)容,具體內(nèi)容如下所示:

<div>
<p>邀請碼</p>
//
<p id="inviteCode" class="inviteCode">{{invite_code}}</p>
<input id="inviteCode" class="inviteCode" type="text" />
<p class="copy">復制</p>
</div>

copy() {

var Url2 = this.invite_code;

//var oInput = document.createElement("input");

var oInput = document.getElementById("inviteCode");

//oInput.value = Url2;

// document.body.appendChild(oInput);

oInput.select();// 選擇對象

//document.execCommand("Cut","false",null);// 執(zhí)行瀏覽器剪切命令

document.execCommand("Copy");// 執(zhí)行瀏覽器復制命令

//oInput.className = "oInput";

//oInput.style.display = "none";

alert("復制成功");

//console.log(document.execCommand("Copy"))

},

總結

以上所述是小編給大家介紹的JS實現(xiàn)移動端點擊按鈕復制文本內(nèi)容,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!

相關文章

最新評論