jq对页面元素进行排序

利用sort函数排序;
var div = $('.media').toArray().sort(function(a,b){

return parseInt($(a).find('.info .price .number-font').text()) - parseInt($(b).find('.info .price .number-font').text())

});
$(div).appendTo('.content_body')

原文地址:https://www.cnblogs.com/JahanGu/p/8781338.html