I'm trying to do a button to copy a link (www.google.com) to the clipboard, but it's not working. My code is:
<script type='text/javascript'>
    function myFunction() {
      /* Get the text field */
      var copyText = document.getElementById("www.google.com");
    
      /* Select the text field */
      copyText.select();
      copyText.setSelectionRange(0, 99999); /* For mobile devices */
    
       /* Copy the text inside the text field */
      navigator.clipboard.writeText(copyText.value);
    
      /* Alert the copied text */
      alert("Copied link!");
    }
</script>
And the button:
<button onclick='myFunction()'>Clik to copy the Link</button>
 
     
    