Copies the provided text to the clipboard using the Clipboard API.
If the Clipboard API is not available or fails, it falls back and creates a new textarea element,
sets its value to the text to be copied, selects it, and then uses document.execCommand('copy') to copy the text.
Copies the provided text to the clipboard using the Clipboard API.
If the Clipboard API is not available or fails, it falls back and creates a new textarea element, sets its value to the text to be copied, selects it, and then uses
document.execCommand('copy')
to copy the text.