博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
jq对页面元素进行排序
阅读量:7198 次
发布时间:2019-06-29

本文共 272 字,大约阅读时间需要 1 分钟。

利用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

你可能感兴趣的文章