Expanded a previous question and it is working fine with the exception to the daily output. As the user enters each week/daily intake of supplement packs it should display to screen until the number of days entered is met. If a user input 2 weeks and 3 days (number of days packs were taken each week) the output should look like:

```
Week 1
Number of packs taken on Day 1 = 2
Number of packs taken on Day 2 = 1
Number of packs taken on Day 3 = 3

Week 2
Number of packs taken on Day 1 = 1 etc....

```

My code keeps writing over Week 1. I'm sure this is something simple that I overlooked. Maybe a variable to hold each weeks input? My code thus far...thanks for the help.

```
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Daily Supplement Intake Log</title>
<script>
function getSup() {
    var numWeeks = parseInt(document.getElementById("week").value);
    var daysPerWeek = parseInt(document.getElementById("day").value);
    var sum = 0; 
    var i = 0; 
    var total = 0; 

    while(i < numWeeks) {
       var d = 0; 
       var grandTotal = 0; 
       var maxPacks = 0; 
    var highDay = 0; 
    while(d < daysPerWeek){
        var packsTaken = prompt("Enter the number of packs taken on week " + (i + 1) + " and day "+ (d + 1), "");
        total = parseInt(packsTaken);
        document.getElementById("output2").innerHTML+="Number of packs  for day " + (d + 1) + " = " + total + "<br />";

            if(packsTaken > maxPacks){
                maxPacks = packsTaken;
                highDay = d;
                }
        sum += total;
        d++;
    }
    grandTotal += sum;
    i++;
    document.getElementById("output1").innerHTML="Week " + i + "<br />";
    document.getElementById("output3").innerHTML="Week " + i + " 
    subtotal is " + sum + " supplement packs." + "<br>" 
    + "Week " + i + " largest day is " + maxPacks + " packs, on day " + d + "<br>";
}
document.getElementById("output4").innerHTML="The total for these weeks  
is " + grandTotal + " supplement packs." + "<br>";
}

</script>
<body>
<header><h1>Daily Supplement Packet Log</h1></header><br>
<section>
<div class="align">
<label>Number of weeks:</label>
<input type="text" name="textbox" id="week" value=""><br>
<label>Number of days per week:</label>
<input type="text" name="textbox" id="day" value=""><br></div>
<div id="button">
<button type="button" id="log" onclick="getSup()">Enter number of packs  
taken each day</button></div> 
</section>
<div id="output1"></div>
<div id="output2"></div>
<div id="output3"></div>
<div id="output4"></div>
</body>
</html>

```