title: Javascript text box input and simple math
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  Please enter a number:&lt;BR&gt;
  &lt;input type="text" id="amount_input"&gt;
  &lt;button onclick="other_amount_input()"&gt;Submit&lt;/button&gt;
  &lt;script&gt;
  var balance=502.73;
  function other_amount_input() {
      var input = document.getElementById("amount_input").value;
      var new_total = parseInt(input) + balance;
      alert("The amount deposited is: $" + input + ".00\n" + "This is the old balance: $" + balance + "\n" + "The new total is : $" + new_total);
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to make an input box with html and javascript that takes an input (a positive number, can be a decimal but only to the hundredth place) I have the web page working to where it will take a whole number and add it to a hard coded number and display the output which is "hard_coded_number + input_number = output_number"</p>