$('.copyBttn').click(function () {copy('linkUrls','已复制')// linkUrls 为要复制元素的ID})function copy(id, text) {const range = document.createRange();range.selectNode(document.getElementById(id));const selection = window.getSelection();if (selection.rangeCount > 0) selection.removeAllRanges();selection.addRange(range);document.execCommand('copy');alert(text);}