I have created a random number generator and i want to avoid repeating the same values. Here is my code:
function function1(){ var randomNumber = Math.floor(Math.random() * 30) + 1; var imgName = "pic (" + randomNumber + ").jpg"; document.getElementById("imgid2").src="Pictures" + "/" + imgName;
Aucun commentaire:
Enregistrer un commentaire