Discuss / JavaScript / 答案

答案

Topic source

lmtooT_T

#1 Created at ... [Delete] [Delete and Lock User]
var list = document.getElementById('test-list');
var texts = Array.prototype.map.call(list.children,function(node){
    return node.innerText.trim();
});
texts.sort();
texts.forEach(function(text,i){
    list.children[i].innerText=text;
});

nbamboo

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

每次看到你心情就不好

梅妹_你

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

为什么要写这么复杂,js不好,看不懂


  • 1

Reply