This commit is contained in:
Karan
2021-11-24 19:32:20 +05:30
parent c5293bd196
commit cbce47bc22
2 changed files with 205 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html><html>
<head><title>Random String Generator</title></head>
<body>
<script>
let output = "";
let letters = "abcdefghijklmnopqrstuvwxyz";
let total = prompt('How many letters in the output?');
total = (isNaN(total)) ? 10 : total;
for (var i = 0; i < total; i++) {
output += letters.charAt(Math.floor(Math.random() * letters.length));
}
console.log(output);
</script>
</body>
</html>