Listbox.Length always 0 in JS
<p>When I run the following JS I always get the confirm box popping up despite the list visibly having items.</p>

<pre><code>&lt;asp:ListBox ID="list" runat="server" Width="135px" Rows="8" /&gt;

function CheckListEmpty() {
if ($("#list").length == 0) {
    if (confirm("Are you sure?")) {
        //they clicked OK so save and close
        return true;
    }
    else {
        //do nothing they hit cancel.
        return false;
    }
}
else
    return true;
</code></pre>

<p>}</p>

<p>What am I doing wrong?</p>
