I'm trying to create a loop, for three random sets of numbers that load into an three different unordered lists.
Each list should have three unique random numbers. I'm close, however my code is loading the same numbers, and I tried to do a for loop, but it appears to be loading the same array, and I want three random unique arrays.
$(document).ready(function () {
var arr = [];
for (var i = 0, l = 4; i < l; i++) {
rand = Math.random(3, 7).toFixed(2);
arr.push('<li>' + 10 + rand * 1 + '</li>')
$("." + i).append(arr);
};
});
Math.randomdoes not take any arguments? What are3,7supposed to do?arr, and load that same array into all the lists. What else did you expect?