Skip to content

Commit cc55d9c

Browse files
committed
fixed duplicate property
1 parent ac78298 commit cc55d9c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Random Password Generator/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="container">
1414
<div class="inputBox">
1515
<h2>Random Password Generator</h2><input type="text" placeholder="Create password" id="password">
16-
<div id="btn" onclick="generatePassword();">Generate Password</div>
16+
<div id="btn">Generate Password</div>
1717
</div>
1818
<!--inputBox-->
1919
</div>

Random Password Generator/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//generate random password using for loop
2-
function generatePassword() {
2+
document.getElementById("btn").addEventListener("click", function() {
33
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+?<>{}[]:";
44
var passwordLength = 10;
55
var password = "";
@@ -8,7 +8,7 @@ function generatePassword() {
88
password += chars.charAt(randomChar);
99
}
1010
document.getElementById("password").value = password;
11-
}
11+
});
1212

1313
//copy to clipboard
1414
clipboard.onclick = function() {

Random Password Generator/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
.inputBox {
1919
position: relative;
20-
2120
background: #fdd5d5;
2221
width: 450px;
2322
padding: 20px 30px;
@@ -34,11 +33,8 @@
3433
position: relative;
3534
width: 100%;
3635
height: 45px;
37-
border: none;
3836
margin: 15px 0 20px;
39-
4037
background: #fff;
41-
4238
border: 2px solid lightgrey;
4339
padding-left: 15px;
4440
border-radius: 5px;

0 commit comments

Comments
 (0)