xxxxxxxxxx
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}
xxxxxxxxxx
const copyPassword = () => {
let copyText = document.getElementById('password');
copyText.select();
document.execCommand("copy");
};
xxxxxxxxxx
const copyPassword = () => {
let copyText = document.getElementById("password");
copyText.select();
copyText.setSelectionRange(0, 99999);
navigator.clipboard.writeText(copyText.value);
alert(`Copied password: ${copyText.value}`);
};