Not sure, why it isn't working. I've referenced a bunch of stack overflow answers, but nothing seems to make a difference. I'm just trying to sort all the divs with class="searchMe" by a data-sortStart attribute. The data-sortStart part works fine, so I didn't include that function in this example, but it's basically a for loop that gives each successive div in the loop a data-sortStart of += 1.
here's my code:
$("#search_button").on("click", function() {
appendicize($('.searchMe').sort(reSort));
});
function appendicize(el){
var container = $('#whatWhat');
container.html('');
el.each(function(){
$(this).appendTo(container);
});
}
$('.searchMe').reSort(function (a, b) {
var contentA = $(a).attr('data-sortStart'),
contentB = $(b).attr('data-sortStart');
return (contentA < contentB) ? -1 : (contentA > contentB) ? 1 : 0;
})