-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (19 loc) · 692 Bytes
/
app.js
File metadata and controls
25 lines (19 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function getPassword(){
const chars ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
let passwordLength = 16;
let password = '';
for(let i=0; i < passwordLength; i++) {
let randomNumber = Math.floor(Math.random()*chars.length);
password += chars.substring(randomNumber,randomNumber + 1)
}
document.getElementById('password').value = password;
console.log(
password
)
}
let Namebtn = document.getElementById("btn1");
Namebtn.addEventListener('click',InputMsg);
function InputMsg(){
let Name =prompt("Enter your Name")
Namebtn.textContent = 'Password for '+ Name;
}