var old_list = document.getElementsByClassName('lang'); var new_list = [], old_list_content, i; for(i = 0; i < old_list.length; i++) { old_list_content = old_list[i].innerText; new_list.push(old_list_content); } console.log(new_list.sort()); for(i = 0; i < old_list.length; i++) { old_list[i].innerText = new_list[i]; }
Sign in to make a reply
咚咚锵_C