How to show the first n number of elements in jQuery?
<p>I have a page that has 50 elements with the same class "fields" which are all display none at the moment</p>

<pre><code>&lt;div class="fields" style="display:none;"&gt;
    ...
&lt;/div&gt;
&lt;div class="fields" style="display:none;"&gt;
    ...
&lt;/div&gt;
&lt;div class="fields" style="display:none;"&gt;
    ...
&lt;/div&gt;
&lt;div class="fields" style="display:none;"&gt;
    ...
&lt;/div&gt;
...
</code></pre>

<p>How to I only show the first 3 or whatever number. Plus count them with a count on top like the following example below.</p>

<p>So for example if I needed the first 3 this is what i need the divs to look like</p>

<pre><code>&lt;div class="fields"&gt;
    &lt;h1&gt;Station 1&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="fields"&gt;
    &lt;h1&gt;Station 2&lt;/h1&gt;

&lt;/div&gt;
&lt;div class="fields"&gt;
    &lt;h1&gt;Station 3&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="fields" style="display:none;"&gt;
    ...
&lt;/div&gt;
...
</code></pre>

<p>So basically only some the number of divs that I need...I already have the number of elements I need to show in this blur statement in the station_count variable. Also notice i need a span tag with the count..any ideas on how to do this</p>

<pre><code>    $("#number_station").blur(function(){
        var station_count = $(this).val();
                    //code goes there
    });
</code></pre>
