title: how to set the limit of minimum and maximum value in Jquery or js
body: <p>I have this script for increment decrements value of a text box, it's working fine. Only thing I need to achieve is, I have to set a minimum and maximum value for it to decrements and increments receptively.</p>
  
  <p>I don't need any alert n message to show the user, I just need it should not change the value after reaching to the limit.</p>
  
  <pre><code>  &lt;script&gt;
      $(document).ready(function(){
    $("#up").on('click',function(){
      $("#incdec input").val(parseInt($("#incdec input").val())+1);
     });
  
     $("#down").on('click',function(){
      $("#incdec input").val(parseInt($("#incdec input").val())-1);
     });
  
   });
   &lt;/script&gt;
  </code></pre>