title: Detect if input type 'number' was increased or decreased from previous value
body: <p>Is there a good way to do this? Can you send the original value as well as the new value to jquery/javascript function? Keeping the old value in some global variable just feels a little messy. </p>
  
  <p>EDIT: Context code</p>
  
  <pre><code>&lt;input type='number' onchange='foo(...)'&gt;
  
  ...
  
  &lt;script type=text/javascript&gt;
  function foo(...){
      if(old &gt; new){
          alert('decreased');
      }else{
          alert('increased');
      }
  }
  &lt;/text&gt;
  </code></pre>