标签:body ati man create tde count fun tap rev
$(‘body‘).on(‘tap‘, ‘.copy-btn‘, function (e) {
e.preventDefault();
e.stopPropagation();
const range = document.createRange();
range.selectNode($(this).prev(‘.text‘)[0]);
const selection = window.getSelection();
if (selection.rangeCount > 0) {
selection.removeAllRanges();
}
selection.addRange(range);
document.execCommand(‘copy‘);
alert(‘运单号已复制!‘);
});
标签:body ati man create tde count fun tap rev
原文地址:https://www.cnblogs.com/ZerlinM/p/13985103.html