get last class

This snippet gets the last class of a DOM element so if you had a DOM element with class="class1, class2, class3" it would return "class3".

var lastElClass = $(element).attr("class").split("").slice(-1);