|
|
@ -15,16 +15,11 @@ const randomFunc = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
clipboardEl.addEventListener('click', () => {
|
|
|
|
clipboardEl.addEventListener('click', () => {
|
|
|
|
const textarea = document.createElement('textarea')
|
|
|
|
const password = resultEl.innerText;
|
|
|
|
const password = resultEl.innerText
|
|
|
|
if (!password) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
if(!password) { return }
|
|
|
|
}
|
|
|
|
|
|
|
|
navigator.clipboard.writeText(password);
|
|
|
|
textarea.value = password
|
|
|
|
|
|
|
|
document.body.appendChild(textarea)
|
|
|
|
|
|
|
|
textarea.select()
|
|
|
|
|
|
|
|
document.execCommand('copy')
|
|
|
|
|
|
|
|
textarea.remove()
|
|
|
|
|
|
|
|
alert('Password copied to clipboard!')
|
|
|
|
alert('Password copied to clipboard!')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|