手机浏览器扫描二维码访问
取出所有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>
...
...
青云寨二当家孟无机偶然获取奸相与外敌的阴谋。奸相为防止阴谋败露,和外敌一起,秘密展开了一场对青云寨众英雄的大截杀。以柳云风为首的青云寨众英雄,与江湖志士一起,浴血杀敌,最终挫败奸相的阴谋。...
...
...
...