title: Javascript Information Needed
body: <p>Looking for a little guidance. I know its something small and dumb but I'm completely drawing a blank at this point and could use some help. I'm trying to create a mobile app for my class that needs a dynamic table for my results. I'm attempting to create a user input to select a number of &quot;Random powerball tickets&quot; and the table would give &quot;Ticket 1 / Random Numbers.&quot; I have managed to create the random number generator onclick but cant for the life of me figure out the rest.</p>
  <p>HTML- I dont remember how to connect the user input to the button and repeat x amount of times to match.</p>
  <pre><code>&lt;div data-role=&quot;content&quot;&gt;
      &lt;p&gt;This will be a simple application that provide generated powerball numbers between 1-69.&lt;/p&gt;
      &lt;/div&gt;
      &lt;div&gt;
      &lt;button id=&quot;button&quot; onClick=&quot;winningNumbers()&quot; &gt;Powerball Numbers&lt;/button&gt;
      &lt;/div&gt;
      &lt;p id=&quot;outcome&quot;&gt;&lt;/p&gt;
      &lt;table id=&quot;data&quot;&gt;
          &lt;/table&gt;
  
  </code></pre>
  <p>Current Javascript</p>
  <pre><code>var powerball;
  
  function powerballNumbers(max) {
    var ranNum = Math.floor((Math.random() * max) + 1);
    return ranNum;
  }
  
  function main() {
    powerball = [];
    for (i = 0; i &lt; 5; i++) {
      powerball.push(powerballNumbers(69));
    }
    powerball.push(powerballNumbers(26));
  }
  
  
  
  function winningNumbers() {
    main();
    var totalTickets = document.getElementById(&quot;outcome&quot;);
  
    totalTickets.innerText = powerball;
  
  }
  </code></pre>
  <p>Thinking of something like this for the table but know it's not correct</p>
  <pre><code>function updateTable(ticketNumber, powerballNumber) {
    var dataTable = document.getElementById(&quot;data&quot;);
    dataTable.innerHTML = &quot;&quot;;
  
    // create rows of data based on given arrays
    (Not sure what to put here)
      
  
    // create header row
    var thead = dataTable.createTHead();
    var row = thead.insertRow(0);
    var tableHeaders = [&quot;Ticket&quot;, &quot;Numbers&quot;];
    for (var i = 0; i &lt; tableHeaders.length; i++) {
      var headerCell = document.createElement(&quot;th&quot;);
      headerCell.innerHTML = tableHeaders[i];
      row.appendChild(headerCell);
    }
  }
  </code></pre>