MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/JavaScriptTips/comments/10aqzzk/copying_text_to_clipboard_and_handling_result/
r/JavaScriptTips • u/Low_Mammoth_9371 • Jan 13 '23
1 comment sorted by
2
Async copy function:
async function readClipboard() { try { await navigator.clipboard.readText(); alert("Success! Read: " + res) } catch { alert("Failed to read the clipboard: " + err); } } readClipboard("text-to-copy");
2
u/Low_Mammoth_9371 Jan 13 '23
Async copy function: