第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用jQuery單擊按鈕復(fù)制到剪貼板

使用jQuery單擊按鈕復(fù)制到剪貼板

胡子哥哥 2019-06-15 17:28:59
使用jQuery單擊按鈕復(fù)制到剪貼板如何將div中的文本復(fù)制到剪貼板上?我有一個(gè)div,需要添加一個(gè)鏈接,將文本添加到剪貼板。有解決辦法嗎?<p class="content">Lorem Ipsum is simply dummy text of the printing and typesetting industry.  Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p><a class="copy-text">copy Text</a>單擊“復(fù)制文本”后,然后按克特 + V它必須粘在一起。
查看完整描述

3 回答

?
Qyouu

TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超11個(gè)贊

clipboard.js是一個(gè)很好的實(shí)用工具,它允許將文本或HTML數(shù)據(jù)復(fù)制到剪貼板,而無(wú)需使用Flash。它非常容易使用,只需包含.js并使用如下所示:

<button id='markup-copy'>Copy Button</button><script>
    document.getElementById('markup-copy').addEventListener('click', function() {
        clipboard.copy({
            'text/plain': 'Markup text. Paste me into a rich text editor.',
            'text/html': '<i>here</i> is some <b>rich text</b>'
        }).then(
            function(){console.log('success'); },
            function(err){console.log('failure', err);
        });
    });</script>

js也在GitHub上。.

2016年1月15日編輯:頂答案曾.編輯今天在我的答復(fù)中引用了同樣的API,在2015年8月發(fā)布。之前的文本指示用戶(hù)使用ZeroClipboard。我只想說(shuō)清楚,我并沒(méi)有從jFriend00的回答中摘取這個(gè)信息,而是相反。


查看完整回答
反對(duì) 回復(fù) 2019-06-15
  • 3 回答
  • 0 關(guān)注
  • 6526 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)