title: how to increment and decrement the text box value using javascript?
body: <p>i am trying increment and decrement a number if user is giving in text box is 15 it should be incremented when click a button and also decrement when button clicking...</p>
  
  <p>this is my javascript code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript"&gt;
  
      function incNumber() {
          for(i=1;i&gt;0;i++){
          document.getElementById("display").value=i;
      }
      }
  
      function decNumber() {
          for(i=1;i&gt;0;i--){
          document.getElementById("display").value=i;
      }
      }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
      &lt;input type="text" value="0"/&gt;
      &lt;input type="button" value="Increase" id="inc" onclick="incNumber()"/&gt;
      &lt;input type="button" value="Decrease" id="dec" onclick="decNumber()"/&gt;
  
      &lt;label id="display"&gt;&lt;/label&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>