[Solved] How to add images in divs randomly using JavaScript?
check this fiddle FIDDLE var limit = 5, amount = 5, lower_bound = 1, upper_bound = 10, unique_random_numbers = []; if (amount > limit) limit = amount; //Infinite loop if you want more unique //Natural numbers than existemt in a // given range while (unique_random_numbers.length < limit) { var random_number = Math.round(Math.random()*(upper_bound – lower_bound) + … Read more