Jquery count selection-boxes that have an item selected
<p>i wonder if there is a more efficient way of counting the selections of a user:</p>

<p>This is the selection dropdown that is multiple times on the page:</p>

<pre><code>&lt;select class="span2 jquery-countable" name="category[7]"&gt;
    &lt;option&gt;&lt;/option&gt;
    &lt;option value="1"&gt;1. vote&lt;/option&gt;
    &lt;option value="2"&gt;2. vote&lt;/option&gt;
    &lt;option value="3"&gt;3. vote&lt;/option&gt;
    &lt;option value="4"&gt;4. vote&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>This is my js that counts the selections:</p>

<pre><code>$(document).ready(function () {

    $('#selected-count').html('You choose ' + getCount() + ' entries');

    function getCount() {
        prio1 = $('.jquery-countable option:selected[value="1"]').length;
        prio2 = $('.jquery-countable option:selected[value="2"]').length;
        prio3 = $('.jquery-countable option:selected[value="3"]').length;
        prio4 = $('.jquery-countable option:selected[value="4"]').length;

        return prio1 + prio2 + prio3 + prio4;
    }

    $('.jquery-countable').change(function () {
        $('.jquery-countable option:selected').each(function () {
            $('#selected-count').html('You choose ' + getCount() + ' entries');
        })
    })
});
</code></pre>

<p>My goal is it to count all selections that where made by the user that are not empty?!</p>

<p>Is there a more efficient way?</p>

<p>Thanks!</p>
