// sort list:
var list = document.getElementById('test-list'),li = list.children;
const aa = Array.prototype.slice.call(li).sort((a, b) => {
return a.innerText >= b.innerText ? 1 : -1
})
aa.forEach(v => {
list.appendChild(v)
Sign in to make a reply
用户6295308231
// sort list:
var list = document.getElementById('test-list'),li = list.children;
const aa = Array.prototype.slice.call(li).sort((a, b) => {
return a.innerText >= b.innerText ? 1 : -1
})
aa.forEach(v => {
list.appendChild(v)
})