Discuss / JavaScript / 作业:

作业:

Topic source

winner丶John

#1 Created at ... [Delete] [Delete and Lock User]

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]

}

}

}

winner丶John

#2 Created at ... [Delete] [Delete and Lock User]

这题有错误,不好意思哈!


  • 1

Reply