欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS實(shí)現(xiàn)移動(dòng)端點(diǎn)擊按鈕復(fù)制文本內(nèi)容

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

移動(dòng)端點(diǎn)擊按鈕復(fù)制文本內(nèi)容,具體內(nèi)容如下所示:

<div>
<p>邀請(qǐng)碼</p>
//
<p id="inviteCode" class="inviteCode">{{invite_code}}</p>
<input id="inviteCode" class="inviteCode" type="text" />
<p class="copy">復(fù)制</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();// 選擇對(duì)象

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

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

//oInput.className = "oInput";

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

alert("復(fù)制成功");

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

},

總結(jié)

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

相關(guān)文章

最新評(píng)論