jquery: i have to use parseInt() even when deal with numbers, why?
<p>i have the following script</p>

<pre><code>&lt;select id="select1"&gt;
      &lt;option value="1"&gt;1day&lt;/option&gt;
      &lt;option value="2"&gt;2day&lt;/option&gt;
      &lt;option value="3"&gt;3day&lt;/option&gt;
    &lt;/select&gt;

    &lt;select id="select2"&gt;
      &lt;option value="1"&gt;1day&lt;/option&gt;
      &lt;option value="2"&gt;2day&lt;/option&gt;
      &lt;option value="3"&gt;3day&lt;/option&gt;
    &lt;/select&gt;
</code></pre>

<p>and jquery</p>

<pre><code>$("#select2").change(function() {
            var max_value = parseInt($("#select2 :selected").val());
            var min_value = parseInt($("#select1 :selected").val());
            if(max_value &lt; min_value)
            {
              $("#select1").val($(this).val());
            }
        });
</code></pre>

<p>and now, what i can't understand anyway - if values of option elements are integer numbers, why i have to use parseInt()? in some cases it doesn't work without parseInt().</p>

<p>Thanks</p>
