Вот так...
<!DOCTYPE html>
<html>
<head>
<style>
</style>
<script>
function Sort() {
var o=document.getElementById('oList')
var ol=o.getElementsByTagName('li')
var i
var move
do {
move=false
for (i=0; i<ol.length-1; i++) {
if (ol[i].innerHTML>ol[i+1].innerHTML) {
o.appendChild(ol[i])
move=true
}
}
} while (move)
}
</script>
</head>
<body>
<UL ID = 'oList'>
<LI>List Item 2</LI>
<LI>List Item 4</LI>
<LI>List Item 1</LI>
<LI>List Item 3</LI>
</UL>
<INPUT TYPE = 'button' VALUE = "Sort List" onclick = "Sort()">
</body>
</html>