<div id='panelb'>
<div class='item'>Ćao</div>
<div class='item'>Bella</div>
<div class='item'>Mare</div>
</div>
I sort the above divs using following code:
js
var items = $('.item').get();
items.sort(function(a, b) {
return $(a).text().localeCompare($(b).text());
});
$('#panelb').append(items);
It works, but what I need is to check if items are sorted or not, before the above procedure.
Something like:
if ('.item').are(:sorted) {alert ('sorted');}
else {alert ('not sorted');}
Any idea?