1var classList = $('#divId').attr('class').split(/\s+/);
2$.each(classList, function(index, item) {
3 if (item === 'someClass') {
4 //do something
5 }
6});
1var classes = $('#test').attr('class').split(' ');
2
3alert(classes[0]); // first class
4alert(classes[1]); // second class
5alert(classes[2]); // third class