I am new to the topic of web development and I really want to make a memory game, I have seen one or another tutorial but they are with Jquey which I still do not know very well since I just start with javascript, the question is that I make it appear only a couple of images, I have the function that makes for each recharge the images are placed in a different box, but I can not perform the function that makes me only appear two of each image ... here is what I have done ...
var imgTags = document.getElementsByTagName('img');
var imagenes = ['ariel.jpg', 'bella.jpg', 'bestia.jpg', 'blanca.jpg', 'cenicienta.jpg', 'dana.jpg', 'jazmin.jpg', 'rapuncel.jpg'];
function numeroAleatorio(max, min) {
var aleatorio = Math.floor(Math.random() * (max - min + 1) - min);
return aleatorio;
}
function rotarFichas() {
for (var i = 0; i < imgTags.length; i++) {
imgTags[i].src = imagenes[numeroAleatorio(imagenes.length - 1, 0)];
}
}
window.onload = rotarFichas;