2320 shaares
// Shuffles elements in a list
// By - Yair Even Or
var ul = document.querySelector("ul"), // get the list
temp = ul.cloneNode(true); // clone the list
// shuffle the cloned list (better performance)
for (var i = temp.children.length + 1; i--; )
temp.appendChild( temp.children[Math.random() * i |0] );
ul.parentNode.replaceChild(temp, ul); // copy shuffled back to 'ul'