📅  最后修改于: 2022-03-11 15:03:38.359000             🧑  作者: Mango
function handleCopyTextFromParagraph() {
const cb = navigator.clipboard;
const paragraph = document.querySelector('p');
cb.writeText(paragraph.innerText).then(() => alert('Text copied'));
}