js 点击复制

来源:互联网 发布:office mac 2016 激活 编辑:程序博客网 时间:2024/05/29 15:52
var range = document.createRange();
                range.selectNode(document.getElementById('address'));


                var selection = window.getSelection();
                if(selection.rangeCount > 0) selection.removeAllRanges();
                selection.addRange(range);
                document.execCommand('copy');
原创粉丝点击