Here is my jsFiddle code.
Please help me out of this. I want sort it in ascending order according to the class names product_tag-pro-1, product_tag-pro-2 ... etc.. But the lists are arranging according to the post-* numbers.
I could not find out the solution.
for(var i=1; i<=jQuery("body.term-california-online-practice-exams ul.products li").length; i++){
var s = productContainer.find(">li:nth-child("+i+")").attr('class').split(' ').join('.');
productContainer.append(productContainer.find("li").get().sort(function(a, b) {
return parseInt(jQuery(a).attr("class").match(/\d+/), 10) - parseInt(jQuery(b).attr("class").match(/\d+/), 10)
}))
}