Answers for "quote generator js"

1

javascript quote generator

<script>
  function genQuote() {
    var quotes = [
        "\"Dude, suckin' at something is the first step at being sorta good at something.\"<br>-  Jake <small><em>(Adventure Time)</em></small>", 
        "\"Either I will find a way, or I will make one.\"<br> - Philip Sidney", 
        "\"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.\"<br>- Thomas A. Edison", 
        "\"You are never too old to set another goal or to dream a new dream.\"<br>- C.S Lewis",
    ];   
    var randNum = Math.floor(Math.random() * quotes.length)
    document.getElementById('quote').innerHTML = quotes[randNum];
}
genQuote();
</script>

<body onload='genQuote()'>
  <div id='quote'></div>
</body>
Posted by: Guest on September-11-2021

Browse Popular Code Answers by Language