点击复制文本框中的内容

创建一个idbasic_wxhHTML盒子
在时间里边调用该函数copyArticle

function copyArticle() {
        var range = document.createRange();
        range.selectNode(document.getElementById('basic_wxh'));
        var selection = window.getSelection();
        if (selection.rangeCount > 0) selection.removeAllRanges();
        selection.addRange(range);
        document.execCommand('copy');
    }
发布了54 篇原创文章 · 获赞 7 · 访问量 2059

猜你喜欢

转载自blog.csdn.net/baobao__/article/details/103800869