Might be a newbie question. I have a code line like this:
I need to get each class for itself.
You can do this way too using map:-
map
var ArrayData = $.map($(this).attr("class").split(' '), function(value){ return value; }); alert("first class = '"+ArrayData[0]+"'"); alert("last class = '"+ArrayData[ArrayData.length - 1]+"'");
Refer LIVE DEMO