trevortrey
New Member
I am trying to get this class name dynamically in jquery:\[code\]echo "<div id=\"maini\" class=\"type_" .$category. " start_" .$adSize. " color_" .$color. "\"> \n"; echo " " . $siteName . " \n"; echo "</div> \n";\[/code\]as you can see the class name is generated with PHP.I need the class name for this snippet of code. But what I tried does not work -> $("div." + this.id). :\[code\] $(document).ready(function() { maini_s = $("div." + this.id).remove(); num_of_arts = maini_s.length; ipp = 3;\[/code\]Here is the entire js file in case you need to see the other elements before.\[code\]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 < (new_page_index+1)*ipp ;i++) { if (i < num_of_arts) { pc.append(maini_s); } } return false;}$(document).ready(function() { maini_s = $("div." + this.id).remove(); num_of_arts = maini_s.length; ipp = 3; // First Parameter: number of items // Second Parameter: options object $("#News-Pagination").pagination(11, { items_per_page:ipp, callback:handlePaginationClick });});\[/code\]