I need to showcase multiple duplicates of 2 different images on a webpage. Users are asked for the duplication speed, which I have already implemented, and also how many copies of each image they want.
function show_image() {
var img = document.createElement("img");
var img2 = document.createElement("img");
img.src = "map.png";
img2.src = "figure-front.png";
document.body.appendChild(img);
document.body.appendChild(img2);
setTimeout("show_image()", speed);
max = 0;
max++
if (max = count) {
return;
}
}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8>
<title>JavaScript Slide Show</title>
<script src="ShowImages3.js></script>
<script>
var speed = prompt("Enter the speed at which you want to duplicate", "");
var count = prompt("Enter how many copies of each image you want to display", "");
</script>
</head>
<body onLoad="show_image()">
</body>
</html>
Nevertheless, it seems to be running indefinitely