title: javascript "less than" if statement failing
body: <p>Here is my function:</p>
  
  <pre><code>function reCalculate(i) {
      document.getElementById("Q" + i).value = document.getElementById("C" + i).value - document.getElementById("QA" + i).value;
  
      if (document.getElementById("Q" + i).value &lt; 0) {
          document.getElementById("Q" + i).value = 0;
      }
      if (document.getElementById("Q" + i).value &lt; document.getElementById("E" + i).value &amp;&amp; document.getElementById("Q" + i).value != 0) {
          alert(document.getElementById("Q" + i).value + " is less than " + document.getElementById("E" + i).value + "?");
          document.getElementById("Q" + i).value = document.getElementById("E" + i).value;
      }
      document.getElementById("Q" + i).value = Math.ceil(document.getElementById("Q" + i).value);
  }
  </code></pre>
  
  <p>It checks Q, if it's less than 0, it makes it 0. Then, if it's not 0, but it's less than E, it makes it E. For some reason this function works UNLESS Q is a double digit number.</p>
  
  <p>For example, if Q is 7 and E is 2, then it will leave Q at 7. However, if Q is 10 and E is 2, for some reason it thinks that 10&lt;2, and it changes Q to 2!</p>
  
  <p>Am I missing something here??</p>