Help with function inside of event using jquery
<p>I have a CheckBox list and I want to get the number of items selected when a checkbox is checked/unchecked.</p>

<p>checkCount is always 0.  It seems to me like checkCount is getting assigned when the page loads and the getCheckCount function is never called again.  Why doesn't this work and how can I get the event to have an up to date checkCount?  Thank you.</p>

<pre><code>   $(function () {
        $('#&lt;%=cblInterests.ClientID%&gt; input').click(function () {
            var checkCount = getCheckCount();
            alert(checkCount);
            return checkCount &lt; 2;
        });
    });        

    function getCheckCount() {
        return $('#&lt;%=cblInterests.ClientID%&gt;').children('input:checked').length;
    }
</code></pre>
