Discuss
/
JavaScript
/
作业没贴在代码块中好难看
作业没贴在代码块中好难看
Topic sourcevar ul = $('#test-div ul');
['Pascal','Lua','Ruby'].map(function (x){
ul.append('<li><span>'+x+'</span></li>');
});
ul.append(ul.find('li').sort(function (x,y){
return $(x).text()>$(y).text()? 1: -1;
}));
- 1
froest2012