手机浏览器扫描二维码访问
从大到小排序
functionbigtosmall(){
allarr.sort(function(a,b){returnb.name-a.name});
appenddom()
}
取出所有li的data-num属性放进数组
getdom()
functiongetdom(){
$(#catalogulli).each(function(m){
domarr[m]=$(this).attr("data-num");
htmlarr[m]=$(this).html();
})
for(vari=0;i<domarr.length;i++){
varactivesubjectsobject={};
for(varj=0;j<htmlarr.length;j++){
if(i==j){
activesubjectsobject.name=domarr[i];
activesubjectsobject.value=htmlarr[j];
allarr.push(activesubjectsobject);
}
}
}
console.log(allarr.length)
}
铺数据
functionappenddom(){
$("#catalogul").html("")
for(i=0;i<allarr.length;i++){
$(#catalogul).append(
<lidata-num=${allarr[i].name}>${allarr[i].value}<li>
);
}
}
<script>
<body>
<html>
...
...
神医。神医无双,一骑绝尘。红粉佳人倾城倾国。那一年,风雪满京城,草根的我,一鸣惊人...
...
quot这一段从零开始的交易,却在我与他日久生情的相处中产生了畸形的爱。人生若如初见,我要谢谢你,赠我空欢喜。quot...
人人都说属羊的命不好。高阳属羊。这么大点离家出走,遇上个男的花言巧语一哄,到时候就得挺个大肚子回来,瞧着吧。高阳属羊吧,属羊的这个命啧啧。她能出息我直接从田里爬回来,她就高中文凭。姥爷说烂泥扶不上墙。亲奶奶说别是为了钱,去当小姐了吧。这个世界上真心盼着你好的,只有你的母亲。母女双...