I have looked at many posts but could not find a clear current answer to the following two questions as it seems standards and browser support has been constantly changing.<
For this, we can use browser API. It's worked for me
async copyClipboard(string){ await navigator.clipboard.writeText(string); console.log("Text copied"); }