jquery: change the value of `select1` onchange of `select2` IF $('#select2').val() < $('#select1').val()
<p>i've asked the first question about selects <a href="http://stackoverflow.com/questions/2934974/change-selects-value-onchange-of-another-select">here</a>, i thought, that when i resieve an answer, i would solve and the second part of my problem, but there was a short way to solve first problem, so i have to ask a question again, about second part:</p>

<p>i have two selects</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 i need to change the value of <code>select1</code> onchange of <code>select2</code>, </p>

<pre><code>if $('#select2').val() &lt; $('#select1').val();
</code></pre>

<p>i try to write the following function</p>

<pre><code> $("#select2").bind('change',function() {
            if($('#select2').val() &lt; $('#select1').val())
            {
              $("#select1").val($(this).val());
            }
        });
</code></pre>

<p>but it doesn't eork, becouse on the moment of change, when i call the function, it doesn't change it's value yet.
so, what can i do?</p>

<p>Thakns</p>
