var
i,c,
list = document.getElementById('test-list')
for(i = 0;i < list.children.length;i++){
c = list.children[i]
for(var j = 0;j < i;j++){
let p = list.children[j];
if(c.innerText < p.innerText){
[c,p]=[p,c]
}
这题有错误,不好意思哈!
Sign in to make a reply
winner丶John
var
i,c,
list = document.getElementById('test-list')
for(i = 0;i < list.children.length;i++){
c = list.children[i]
for(var j = 0;j < i;j++){
let p = list.children[j];
if(c.innerText < p.innerText){
[c,p]=[p,c]
}
}
}