Change a div and the element type text compare
<p>I have a form that has a select menu(A) and 2 divs (B and C) and an input type of text (D).
I would like to have the select menu drop down(A) selections affect the value that get shown in div B.Then when a user enters a value in the text element D,the value is compared to the value in B and C would output (show) wether the value is big or small than that in B.</p>

<p>So far I have been using the jquery blur function and its proving inconsistent     </p>

<pre><code>$('.expCheck').blur(function() {
    var curr = $(this).val();
    var prevField = parseInt($(this).parent().prev('td').children('.getValue').text());
    var compField = $(this).parent().next('td').children('.compCheck');
    compField.css('background-color','#c00');

    if (curr &lt; prevField) {
        compField.css('background-color','#c00').text('Failed');
    } else {
        compField.css('background-color','#0c0').text('Passed'); 
    }
});
</code></pre>

<p>the html structure </p>

<pre><code>&lt;form method="post" enctype="multipart/form-data" name="testForm" id="testForm" action="test_process.php"&gt;
    &lt;select name="day_select" id="day_select" class="daychanger"&gt;
        &lt;option value="0"&gt;--Please Select Days--&lt;/option&gt;
        &lt;option value="1"&gt;1- 7 Days&lt;/option&gt;
        &lt;option value="2"&gt;8-14 Days&lt;/option&gt;
        &lt;option value="3"&gt;15-21 Days&lt;/option&gt;
    &lt;/select&gt;

    &lt;table class="mtbl"&gt;
        &lt;tr class="head"&gt;
            &lt;td width="297"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;td width="297"&gt;Required Days&lt;/td&gt;
            &lt;td width="246"&gt;Your Days&lt;/td&gt;
            &lt;td width="246"&gt;Status&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr class="info'&gt;
            &lt;td&gt;Days &lt;/td&gt;
            &lt;td&gt;
                &lt;div id="v1" class="getValue"&gt;&lt;/div&gt;
            &lt;/td&gt;
            &lt;td align="left"&gt;
                &lt;input class="expCheck" name="days" type="text" id="days" size="5"  maxlength="5" /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;div class="compCheck"&gt;&lt;/div&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/form&gt;
</code></pre>
