Aetae,
Спасибо!!!
Вариант с учётом ИЕ
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<title></title>
</head>
<body>
<div id="list" ></div><div id="test"></div>
<input type="button" value="go" onclick="n(arr.sort(rand))"/>
<script type="text/javascript">
var arr = [];
var list = document.getElementById('list');
var test = document.getElementById('test');
function spisok(c) {
for (var a = 0; a < c; a++) {
var b = document.createElement("P");
b.innerHTML = "Элемент списка №" + a;
list.appendChild(b);
arr[a] = a
}
test.innerHTML = arr
};
function rand() {
return .5 - Math.random()
}
spisok(5)
var n = function () {
for (var c = list.getElementsByTagName("p"), d = [], a = 0; a < c.length; a++) d[a] = c[a];
return function (a) {
for (var b = 0; b < a.length; b++) list.appendChild(d[a[b]]);
test.innerHTML = a
}
}();
</script>
</body>
</html>