title: Add/Subtract Click Function
body: <p>Can anyone modify this code to [Add by left clicking the number], and [Subtract by right clicking the number]?</p>
  
  <p>This would get rid of the + and - buttons.</p>
  
  <p>I can't figure out how to do it.</p>
  
  <p><strong><a href="http://jsbin.com/oxeyeb/57/edit" rel="nofollow">DEMO</a></strong></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input id="txtNumber" type=text" value="55" style="width:30px" /&gt;
  &lt;input id="btnAdd" type="button" value="+" onclick="add();" /&gt;
  &lt;input id="btnSubtract" type="button" value="-" onclick="subtract();" /&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>function add()
  {
    var txtNumber = document.getElementById("txtNumber");
    var newNumber = parseInt(txtNumber.value) + 1;
    txtNumber.value = newNumber;
  }
  
  function subtract()
  {
    var txtNumber = document.getElementById("txtNumber");
    var newNumber = parseInt(txtNumber.value) - 1;
    txtNumber.value = newNumber;
  }
  </code></pre>