How to show 3 random item of list using jquery?
<p>I have a big list <code>&lt;li&gt;</code> of items and a button to "shuffle" the list, what I'm trying to achieve is, show only 3 RANDOM list items when the page loads, then on button click, shuffle the list, hide the current 3 list items and show OTHER RANDOM list items.</p>

<p>What I did till now is this, but it doesn't really do everything I'm trying to achieve, I get 3 items showed only, but they get randomised between the same 3 list items always...</p>

<pre><code>$('.fr_revs &gt; li').hide().filter(':lt(3)').show();

var ul = document.querySelector('.fr_revs');
for (var i = ul.children.length; i &gt;= 0; i--) {
    ul.appendChild(ul.children[Math.random() * i | 0]);
}
</code></pre>

<p>Can somebody help me please. Thank you</p>