I need to get the second class from an element which has two different classes, so i try the split method but something is wrong, can u help me?
js_kp_main_list.find('li#kp_r_04').addClass('class_01 class_02');
setTimeout(function(){
var class_two = js_kp_main_list.attr("class").split(' ')[2];
console.log(class_two);
},20);
You can use className native JS:
EDIT: Another contrived example
http://jsfiddle.net/KqXmN/
HTML
JS