手机浏览器扫描二维码访问
取出所有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>
在苍岚大陆,若想要成为武者,唯有觉醒自身武魂。通过武魂,才能沟通天地,吸纳灵气,进行修行。武魂的种类繁多,五花八门,数不胜数,其中分为了天地玄黄四大等级,每个等级,划分十品。若是武魂等级越高,那么修炼的速度能力与潜力则越强,未来成就强者的希望也就越大。天才少年秦南,锻造绝世武魂!...
让大唐坠入深渊的安史之乱,被我们平定了!...
...
...
...