Searching for an answer to display only one div with a rate of 1/100. Currently, I am utilizing the following JavaScript:
var random = Math.floor(Math.random() * $('.item').length);
$('.item').hide().eq(random).show();
This method works well as long as I have 100 divs with the .item
class, but it results in cluttered code.