I'm a beginner with Javascript and can't get the code below to work. When I click the button, nothing happens. Could someone point out what I did wrong? Thanks!
<html>
<head>
<title>Sarah's Puppy Game</title>
</head>
<body>
<div id="input">
<input id="puppyNumber" size=30>
<button onClick="doLoop()"> Get your puppies </button>
</div>
<script type="text/html">
function doLoop() {
var number = document.getElementById('puppyNumber').value;
var puppy = [];
while (var i = 0; i < parseInt(number); i++) {
puppy = puppy.push('puppy<br>');
}
alert(puppy);
}
</script>
</body>
</html>
alertstatements to get a glimpse of what's happening.