vendredi 21 janvier 2022

HTML Random Number Generator + Options off result

I'm trying to make a random number generator that gives me a random number (1-26) and then gives me a pre-assigned response depending on what number is given to me. I've got the code for the random number generator, but how do I go from here?

This is the code btw

<html>
<body>

<p id="one"></p>
<button onclick="random()">Random</button>

<script>
 function random(){

document.getElementById("one").innerHTML = Math.floor(Math.random() * 26);
}
</script>

</body>



Aucun commentaire:

Enregistrer un commentaire