Skip to content

Commit

Permalink
change function name
Browse files Browse the repository at this point in the history
  • Loading branch information
gusevgrishaem1 committed Nov 9, 2024
1 parent fca1495 commit e8da9cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function generatePassword() {
document.getElementById('password').value = password;
}

function showMessage(msg) {
function showMsg(msg) {
const messageDiv = document.createElement('div');
messageDiv.id = 'message';
messageDiv.textContent = msg;
Expand Down Expand Up @@ -39,10 +39,10 @@ document.getElementById("password").addEventListener("click", function(){
passwordField.setSelectionRange(0, 99999);
navigator.clipboard.writeText(passwordField.value)
.then(() => {
showMessage('Password copied to clipboard!')
showMsg('Password copied to clipboard!')
})
.catch(err => {
console.error('Failed to copy password: ', err);
showMessage('Failed to copy password.');
showMsg('Failed to copy password.');
});
})

0 comments on commit e8da9cb

Please sign in to comment.