Classic "bubble" does not work - nodes are not assigned:
for(var i = 0; i < List.childElementCount; i++){ for(var j = List.childElementCount-1; j > i; j--){ if (parseInt(List.childNodes[j-1].id) > parseInt(List.childNodes[j].id)){ var Buf = List.childNodes[j-1]; List.childNodes[j-1] = List.childNodes[j]; List.childNodes[j] = Buf; } } } I tried List.replaceChild instead of assignment - in general the list is cleaned.
How to sort nodes by their numeric id?
PS: Changing by node attributes is not an option, you need objects entirely, since one of the elements can be selected (marked with another font-weight and color) - this should be preserved during sorting.
