How to get the class names using jquery?
<p>Hey, I'm wondering how I can get the class names dynamically using jquery for the script below.</p>

<p>The HTML output looks like this:</p>

<pre><code>&lt;div id="main-info-1" class="maini"&gt;
     &lt;p&gt;this is a paragraph.&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>So, I'm trying to get the class name dynamically instead of hard coded like it is above.</p>

<p>There are two parts where I need to get the class names in the jquery script:</p>

<pre><code>1.) pc.children('div.maini').remove();

2.) maini_s = $('div.maini').remove();
</code></pre>

<p>As you can see the class 'maini' is hard coded and im unsure how to get the class name dynamically and put it properly in the script.</p>

<p>The jQuery file:</p>

<pre><code>&lt;script type="text/javascript"&gt;   
// make them global to access them from the console and use them
// in handlePaginationClick
var maini_s;
var num_of_arts;
var ipp;

function handlePaginationClick(new_page_index, pagination_container) {
    var pc = $(pagination_container);
    pc.children('div.maini').remove();
    for(var i=new_page_index*ipp; i &lt; (new_page_index+1)*ipp ;i++) {
        if (i &lt; num_of_arts) {
                pc.append(maini_s[i]);
        }
    }
    return false;
}

$(document).ready(function() {
    maini_s = $('div.maini').remove();
    num_of_arts = maini_s.length;
    ipp = 3;

    // First Parameter: number of items
    // Second Parameter: options object
    $("#News-Pagination").pagination(6, {
        items_per_page:ipp, 
        callback:handlePaginationClick
    });
});


        &lt;/script&gt;
</code></pre>

<p>Any help on this would be awesome, thank you.</p>
