I did a very simple way to do this. See if it suits your example:
$('.item').each(function(i){
var rdm = Math.floor(Math.random()*$('.item').length-1)
$(this).before($('.item').eq(rdm));
})
In this case, just change the class .item
to the desired one. To leave only the first class item, just do this:
$('.item').not('.item:first').hide();
Another option
Ney, correct me if I'm wrong, but its purpose seemed to me to be: to hide all the elements of a class, but leaving the show only one element and that the choice of it is random. If so, you can simply do this:
$(document).ready(function(){
var rdm = Math.floor(Math.random()*$('.item').length-1)
$('.item').not($('.item').eq(rdm)).hide();
})
In JsFiddle just give a run that it will randomly change the order.
But for what you have in the question, goes the first option. And another thing, to get a better view remove the br
.