Merge pull request #141 from ndrsov/patch-1
Remove deprecated execComand() function
This commit is contained in:
commit
236f68461b
@ -15,16 +15,11 @@ const randomFunc = {
|
||||
}
|
||||
|
||||
clipboardEl.addEventListener('click', () => {
|
||||
const textarea = document.createElement('textarea')
|
||||
const password = resultEl.innerText
|
||||
|
||||
if(!password) { return }
|
||||
|
||||
textarea.value = password
|
||||
document.body.appendChild(textarea)
|
||||
textarea.select()
|
||||
document.execCommand('copy')
|
||||
textarea.remove()
|
||||
const password = resultEl.innerText;
|
||||
if (!password) {
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(password);
|
||||
alert('Password copied to clipboard!')
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user