//How to copy URL on button click with javascript
<textarea id="url" rows="1" cols="30" style="display:none"></textarea>
function HideUrl() { document.getElementById("url").style.display = "none"; } </script>```
The navigator.clipboard.writeText()
method is used to write text to the clipboard. The url
parameter is used to specify the text that is being copied.
I hope this code works for you.