I have to build a password generator, but when I click on the “Generate Passwords” button, it outputs 1 character at a time, I need it to input 15. What can I do please? Thank you all!
<!doctype html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<h1>Generate a</h1>
<h2>random password</h2>
<p>Never use an insecure password again</p>
<button id="pw-gen" onclick="generating()">Generate Passwords</button>
<div id="pws">
<div id="pw1"></div>
<div id="pw2"></div>
</div>
<script src="index.js"></script>
</body>
</html>
const characters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","~","`","!","@","#","$","%","^","&","*","(",")","_","-","+","=","{","[","}","]",",","|",":",";","<",">",".","?", "/"];
let pw1 = document.getElementById("pw1")
let pw2 = document.getElementById("pw2")
function generating(long) {
let password =""
let newpw1 = Math.floor(Math.random() * characters.length)
let newpw2 = Math.floor(Math.random() * characters.length)
pw1.textContent += characters[newpw1]
pw2.textContent += characters[newpw2]
}