It is possible that this may be something simple or completely wrong, but I'm trying to create a button to copy the current URL to the clipboard, this is what I have now, I'm not too familiar with javascript, so this from several sources mix together and hope for the best.
<button onclick="CopyLink()">Click me</button> <script> function CopyLink() { window.clipboardData.setData("Text", location.href); } </script>
Any help would be greatly appreciated!
source share