Is it possible to test how many options are in a select box?
<p>I am using the jQuery 1.6.2.</p>

<p>I am dynamically populating a select box using ColdFusion and jQuery.</p>

<p>When the options are returned and stuffed inside the select box, I'd jQuery to figure out how many options there are and adjust the size attr as needed. </p>

<pre><code>// load the options into the select box
$("#Select").load("GlobalAdmin/ArtistUnassociatedAlbums.cfm?" + QString);

// test the number of options
var NumOfOptions = $();
var BoxSize = 0;

// do a calculation
if (NumOfOptions &gt; 10) {
    BoxSize = 10;
} else {
    BoxSize = NumOfOptions ;
}

// adjust the select box size
$("#AlbumsSelect").attr("size", BoxSize );
</code></pre>

<p>How do I efficiently get at the number of options returned?</p>
