<div id="stage"></div>
<script>
function removeAll() {document.getElementById("stage").innerHTML = "";}
removeAll();
let svg = document.getElementById("stage");
function drawImages() {
image = document.createElement("img");
image.setAttribute("class", "img-fluid");
image.setAttribute("src", "https://source.unsplash.com/random/900×700" + Math.floor(Math.random() * 99) );
// add these elements to my stage
svg.appendChild(image);
}
drawImages();
// timed refresh
// var reGenTimer = window.setInterval(function () {
// removeAll();
// drawImages();
// }, 3000);
// click to refresh
document.addEventListener("click", function () {
removeAll();
drawImages();
});
</script>