find the divs which do not have style display none and insert a style for page break on every second div
<p>Initially all divs are having style display none property. I am enabling the divs by jquery show method if there is any content inside them,
I want to find the divs which do not have style display:none, and after every second active div,
I want to insert a css for page-break-after:always for print purpose. I want to have only 2 divs in one page when user prints.
so in this example, I want to insert css for page break on par4, and par8 </p>

<p>(so in short find the divs which do not have style display none and insert a style for page break on every second div)</p>

<pre><code>&lt;div id="parent"&gt;
&lt;div class="flip" id="par1" style="display:none;"&gt;empty&lt;/div&gt;                     
&lt;div class="flip" id="par2"&gt;Image/content&lt;/div&gt;                           
&lt;div class="flip" id="par3" style="display:none;"&gt;empty&lt;/div&gt;                       
&lt;div class="flip" id="par4"&gt;Image/content&lt;/div&gt;                            
&lt;div class="flip" id="par5" style="display:none;"&gt;empty&lt;/div&gt;                        
&lt;div class="flip" id="par6"&gt;Image/content&lt;/div&gt;                         
&lt;div class="flip" id="par7" style="display:none;"&gt;empty&lt;/div&gt;                             
&lt;div class="flip" id="par8"&gt;Image/content&lt;/div&gt;                                             
&lt;div class="flip" id="par10" style="display:none;"&gt;empty&lt;/div&gt; 
&lt;/div&gt;
</code></pre>
