0
Hello, I created a random number generator with the following script:
<input type="number" name="minimum" id="minimum">
<input type="number" name="maximum" id="maximum">
<button class="aazul" onclick="result()">Generate</button>
<div class="card" id="resultz"></div>
<script>
function result(){
const min = document.getElementById("minimum").value;
const max = document.getElementById("maximum").value;
let sort = Math.floor(Math.random()*Math.floor(max))
while(sort<min){
sort = Math.floor(Math.random()*Math.floor(max));
}
document.getElementById("resultz").innerHTML=sort;
}
</script>
But it generates a number and when you click the Generate button again it generates another number (as expected). I would like to save a list of 6 numbers generated as a history that would be possible or someone could indicate how to do this?
In Amigo sorry for the insistence. How could I leave these 6 results on the page until I update it? I wanted to create a sequence with the last 6 numbers generated.
– Adeilson Odorico Silva