Why isn't my email-to-clipboard code working?

After clicking on the email, I want it to copy the text to the clipboard and to show the message below.
This is what it should and looks like in the Wix preview, where everything works properly:

This is what it actually acts like after publishing:

This is my code:

// Copies the e-mail on click
$w.onReady( () =>
{
$w('#email').onClick( () => {
    wixWindow.copyToClipboard("my email address")
 .then( () =>
 {
 let fadeOptions = {
 "duration": 200
 };
        $w("#popup").show("fade", fadeOptions);
        setTimeout(()=>{
        $w("#popup").hide("fade");
 },2000);
 });
 });
});

Hi there,

This is a privacy measure from Google to ask for permission before the website can access your clipboard, you can click on the lock icon next to the address bar of the website and allow the site to have access to your clipboard. Unfortunately, this is not something we can fix with a code as it’s controlled by the browser.

Ahmad is right. But, just out of curiosity: what are you trying to achieve? Because I have a slight inkling that you are choosing the complex way for something very easy. Shorter: if you want to copy the value of a wix-element to another wix-element, why go thru the clipboard?