var strs = ['Pascal','Lua','Ruby']; var ul = $('#test-div>ul'); for(s of strs){ ul.append(`<li><span>${s}</span></li>`); } lis=ul.find('li'); lis.sort(function(a,b){ return (a.innerText>b.innerText)?1:-1 }) ul.append(lis);
Sign in to make a reply
Othershe