okay it might be something simple or completely wrong however I'm trying to create a button to copy current URL to clipboard, this is what I currently have, I'm not too familiar with javascript so this is from a few sources mixed together and hoping for the best.
<button onclick="CopyLink()">Click me</button>
<script>
function CopyLink() {
window.clipboardData.setData("Text", location.href);
}
</script>
Any help would be great thanks!