title: How to get the user input from buttons to display in the text box using function (for-loop)?
body: <p>How to get the numbers displayed in the display textbox when the user clicks the number buttons? I do not know what to put in my <code>numInputF()</code> function, I want to use a for-loop function, but I do not know how.</p>
  
  <pre><code>    &lt;script&gt;
  
          var initialMoney = 1000; //Customer's initial money is $1000
          var display;
  
          /* Set the "Type amount and select operation to blank." */
          function setBlankF(){
              document.getElementById("display").value = "";
          }
  
          /* Gets the user input when buttons are clicked. */
          function numInputF(){
  
          }
  </code></pre>
  
  <p>This is my body part. I know that I should put something on the onclick button, but I have not figured out how to make my function, which is why it is blank. </p>
  
  <pre><code>        &lt;table border="1"&gt;
  
              &lt;caption&gt;ATM 360&lt;/caption&gt;
  
                  &lt;tr&gt;
                      &lt;td colspan="4"&gt;
                          &lt;input type="text" id="display" value="Type amount and select operation" size="30" onclick="setBlankF()"&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="1" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="2" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="3" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="Withdrawal" id="withdraw" onclick=""&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="4" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="5" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="6" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="Deposit" id="deposit" onclick=""&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="7" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="8" onclick=""&gt;
                      &lt;/td&gt;
  
                      &lt;td&gt;
                          &lt;input type="button" value="9" onclick=""&gt;
                      &lt;/td&gt;
  
                      &lt;td&gt;
                          &lt;input type="button" value="Retype" id="retype" onclick=""&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="0" onclick=""&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="button" value="End" id="end" onclick=""&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>Thank you in advance.</p>