What is the best way to copy text to the clipboard (multi-browser)? The below code which I have tried.
function copy(data){
let info = data;
document.execCommand("copy");
alert("Copied the text: " + info);
}
I am trying to copy data which I have passed.