Is there a way to sort by class. I am using bootstrap list-group-items and setting a class danger or success depending if it has messages or not. The way the database is makes it pretty hard to do it and the flow of the program makes it hard as well. This would make life a lot easier if there was a way to sort items by class.
$.ajax({
url: "get_name.php",
type: "POST",
async: false,
data: {
funcName: "getBadge",
userId: user_id,
techId: techId,
chat_id: chatId,
},
datatype: "JSON",
success: function(result) {
var temp = result.split("_");
if(temp[0]>0){
$("#" + techId).addClass("list-group-item-danger");
}else{
$("#" + techId).addClass("list-group-item-success");
}
$("#" + techId + " .badge").html(temp[0]);
},