const inputItem = document.getElementById("copyInputId");
inputItem.setAttribute("value", val);
inputItem.select(); // 选择对象
document.execCommand("Copy");
alert("复制成功");
const inputItem = document.getElementById("copyInputId");
inputItem.setAttribute("value", val);
inputItem.select(); // 选择对象
document.execCommand("Copy");
alert("复制成功");