JSFiddle - React, Tailwind, and code Playground

by zachariepertgen

HTML

<html>

  <head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="quotes.js"></script>
  </head>

  <body>

    <div class="quote">

      <h1>Quote of the Day:</h1>
      
      <button onclick="quote()">New Quote</button>
      
      <script>
      var quotes = [

  "Pillage, then burn.",

  "A Sergeant in motion outranks a Lieutenant who doesn't know what's going on.",

  "An ordnance technician at a dead run outranks everybody.",

  "Close air support covereth a multitude of sins."
];

var pickQuote;
var currentQuote;

function quote() {
  pickQuote = Math.floor(Math.random() * (quotes.length));
  currentQuote = quotes[pickQuote];
  document.getElementById('demo').innerHTML = currentQuote;
}

document.addEventListener('DOMContentLoaded', quote, false);
window.alert(currentQuote); 
      </script>
      
      
      <p id="demo"></p>

    </div>