<!DOCTYPE html>
<html>
<head>
<title> Password Generator </title>
</head>
<body>
<button onclick="PasswordGen()">Generate Password</button>
<script>
const emotion = ["Sad", "Happy", "Mad", "Miserable", "Shy", "Cheerful", "Angry", "Amazing", "Anxious", "Scared", "Bashful", "Brave", "Tired", "Excited", "Cautious", "Bubbly"];
const noun = ["Actors", "Queens", "Kings", "Princes", "Princesses", "Cows", "Pigs", "Chickens", "Dogs", "Cats", "Clouds", "Fathers", "Mothers", "Brothers", "Sisters", "Uncles", "Aunties", "Zebras", "Fish", "Elephants"];
const verb = ["Jump", "Play", "Run", "Sprint", "Walk", "Throw", "Fall", "Fly", "Search", "Train", "Grow", "Smell", "Eat", "Whistle", "Write", "Read", "Swim", "Win", "Plan", "Scream", "Sleep"];
function RandomNum(array)
{
return Math.ceil(Math.random() * array.length-1);
}
num1 = Math.ceil(Math.random() * 9);
function PasswordGen()
{
document.write(num1 + emotion[RandomNum(emotion)] + noun[RandomNum(noun)] + verb[RandomNum(verb)]);
}
</script>
</body>
</html>
So im doing some basic coding for tafe and it's been easy so far but im not too good at js and HTML, i've made this button setup put i think it's orinting over the button with the password. I want the button to be there after the password gets printed to re-generate the password.