JQuery each() function not working DropDownList Change
<p>I have a table populated from a selection from a dropdownlist. If the status of any of the items in the table is anything other than 'success', I want to disable a button on the page, otherwise I enable it. I have a change event handler with the following:</p>

<pre><code>function enableButton() {
    $(".myButton").attr("disabled", true);
    $("td.tdStatus").each(function() {
        if ($(this).text() == "SUCCESS") {
            $("input.myButton").attr("disabled", false);
            return false;
        }
    });
}

$(function() {
    $("#myList").change(enableButton);
});
</code></pre>

<p>On the first selection of an item from the dropdown, I'm getting into the event handler but <code>$("td.tdStatus").each(function()</code> isn't finding anything. When I then make a subsequent change to the dropdownlist, the button gets <code>enabled</code>/<code>disabled</code> as I'd expect. Any ideas why the first change isn't working?</p>

<p>HTML is as follows:</p>

<pre><code>&lt;ItemTemplate&gt;
    &lt;tr&gt;
        &lt;td runat="server" id="tdName"&gt;&lt;%# Eval("Name") %&gt;&lt;/td&gt;
        &lt;td class="tdStatus"&gt;&lt;%# Eval("Status") %&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/ItemTemplate&gt;
</code></pre>

<p>Thanks</p>
