Random Quotes

In this example below you will see how to do a Random Quotes with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by natertot12, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright natertot12 ©
  • HTML
  • CSS
  • JavaScript
    <html>
  <body>
    <h1 class="jumbotron text-center">Random Quotes</h1>
    <button class="btn btn-primary center-block main-button">Click For Random quote</button>
    <h2 class="text-center" id="quote"></h2>
  </body>
</html>

/*Downloaded from https://www.codeseek.co/natertot12/random-quotes-LpRXmy */
    


/*Downloaded from https://www.codeseek.co/natertot12/random-quotes-LpRXmy */
    $(document).ready(function() {
  var quotes = ["quote1", "quote2", "quote3"];//put quotes in here.
  $(".main-button").click(function() {
    $('#quote').html(quotes[(Math.floor(Math.random() * quotes.length) + 0)]);
  });
});

Comments