title: Check if a variable is greater than or equal to a number and less than or equal to a number jquery
body: <p>I am trying to write code that will take a number from an HTML input field.</p>
  <ul>
  <li><p>if the number is greater than or equal to 10000 then
  set a new variable to 10000</p>
  </li>
  <li><p>if it is less than or equal to set the new variable to the same value as the other variable.</p>
  </li>
  </ul>
  <pre class="lang-js prettyprint-override"><code>var sc = $('#Single-num1').val(); // Water Amount input
  console.log(sc);
  </code></pre>
  <p>This is the first variable (sc).</p>
  <p>This is what I am trying to get working and the logic makes sense but it won't give me data.</p>
  <pre><code>if (sc &gt;= 10000) {
    var ssa = 10000;
  }
  else {
    var ssa = sc;
  }
  </code></pre>
  <pre><code>&lt;div class=&quot;singlewateramountdiv&quot;&gt;
    &lt;label for=&quot;Single-Water-Amount&quot;&gt;How Much Water Was Used?&lt;/label&gt;
    &lt;input type=&quot;text&quot; id=&quot;Single-num1&quot; name=&quot;Single-num1&quot;/&gt;
  &lt;/div&gt;
  </code></pre>