document.addEventListener('DOMContentLoaded', function() {
var li = document.querySelectorAll('li');
li[Math.floor(Math.random() * li.length)].style.display = 'list-item';
}, false);
$(function() {
var li = $('li');
li.eq(Math.floor(Math.random() * li.length)).show();
});
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<ul>
li{
display: none;
}
window.onload = function(){
show();
}
function show(){
var list = document.getElementsByTagName('li');
list[rand(0, list.length - 1)].style.display = 'block';
}
function rand(min, max){
return Math.floor(Math.random() * (max - min + 1)) + min;
}