title: Basic JS/HTML Calculator
body: <p>I am trying to make a completely basic calculator with JavaScript and HTML. I haven't completely finished it yet but none of my buttons are working. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function NumberClicked(numValue) {
   //alert(numValue);
   document.getElementById("calcInput").value += numValue;
  }
  
  function ClearAll() {
   document.getElementById("calcInput").value = '';
   document.getElementById("calcOutput").value = '';
  }
  
  function Add() {
   var output = document.getElementById("calcOutput");
   output.value = Number(document.getElementById("calcInput").value) + Number(output.value);
  
   document.getElementById("calcInput").value = '';
  }
  
  function Subtract() {
   var output = document.getElementById("calcOutput");
   output.value = Number(document.getElementById("calcInput").value) - Number(output.value);
  
   document.getElementById("calcInput").value = '';
  }
  
  function Divide() {
   var output = document.getElementById("calcOutput");
   if (output.value == "") {
    output.value = document.getElementById("calcInput");
   } else {
    output.value = Number(output.value) / Number(document.getElementById("calcInput").value);
  
   }
   document.getElementById("calcInput").value = '';
  }
  
  function Multiply() {
   //var 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>result&lt;input id="calcOutput" type="text"&gt;
  &lt;br&gt;
  input&lt;input id="calcInput" type="text"&gt;
  &lt;br&gt;
  &lt;button onclick="ClearAll();"&gt;clear&lt;/button&gt;
  &lt;br&gt;
  &lt;button onclick="NumberClicked(7);"&gt;7&lt;/button&gt;
  &lt;button onclick="NumberClicked(8);"&gt;8&lt;/button&gt;
  &lt;button onclick="NumberClicked(9);"&gt;9&lt;/button&gt;
  &lt;button onclick="Divide();"&gt;/&lt;/button&gt;
  &lt;br&gt;
  &lt;button onclick="NumberClicked(4);"&gt;4&lt;/button&gt;
  &lt;button onclick="NumberClicked(5);"&gt;5&lt;/button&gt;
  &lt;button onclick="NumberClicked(6);"&gt;6&lt;/button&gt;
  &lt;button onclick="Multiply();"&gt;*&lt;/button&gt;
  &lt;br&gt;
  &lt;button onclick="NumberClicked(1);"&gt;1&lt;/button&gt;
  &lt;button onclick="NumberClicked(2);"&gt;2&lt;/button&gt;
  &lt;button onclick="NumberClicked(3);"&gt;3&lt;/button&gt;
  &lt;button onclick="Subtract();"&gt;-&lt;/button&gt;
  &lt;br&gt;
  &lt;button onclick="NumberClicked(0);"&gt;0&lt;/button&gt;
  &lt;button onclick="Add();"&gt;+&lt;/button&gt;
  &lt;br&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/isherwood/2ffgtuxv/" rel="nofollow">Fiddle</a></p>