Im looping through all divs on a page trying to get the entire class name (multile class names on a div) - for now im just console.logging them out but it only outputs the fitst match - There are another 7 on the page (within the containing wrap div) but im only getting the first one - any ideas why.
The Classes are named:
pge-rep-1, pge-rep-2, pge-rep-3 ... pge-rep-8
The code is thus:
$('#pagePoints div').each(function (index)
{
if ( $(this).hasClass("pge-rep-"+index) ) {
console.log( $(this).attr('class') );
}
});