Am using the following function to put some text to my clipboard:
navigator.clipboard.writeText('Text to be copied').then(function() {
console.log('Template copied to clipboard')
}, function() {
console.log('Unable to write to clipboard. :-(');
});
Unfortunately, It doesn't work on Mozilla & IE. It works fine on Chrome. I've already tried using:
Document.execCommand('copy')
I found this tutorial in developers.google.com, but the example seems to work fine in Chrome and not in other browsers. What am I doing wrong here ?