Sunday, June 29, 2025

Random Quotes Generator


 

Code:

<script>
    function getq(){
        const quotes = ["A","B","C","D","E","F"];
        const colr= ["red","green","black","pink"];
        var x = Math.floor(Math.random()*quotes.length);
        document.getElementById("show").innerText = quotes[x];
        document.getElementById("show").style.backgroundColor = colr[x];
        document.getElementById("show").style.color = "white";


// alert(quotes[4]);

    }
</script>

<div id="show"></div>
<input type="button" onclick="getq()" value="Generate Quotes">

See video - Go to video

No comments:

Post a Comment

Pure js Quantum Simulation | Qubit program

  Code :  <button type = "button" onclick = " simulate ()" > Measure Qubit </button> <div id = "r...