Jump to content

Button Randomizer

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Add to Code Block

<section id="background">
  <div id="quote-container">
    <h1 id="quote-container-heading">Step Brother Quotes</h1>

    <p id="quote">
      Keep you liver spotted hands off my mother shes a saint

    <h5 id="author">-Dale</h5>

    <a class="button">New Quote</a>
  #background {
  height: 100vh;
  background-repeat: no-repeat;
  background-size: cover;
  color: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
#background p {
  font-size: 24px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
  $(document).ready(function() {

  var quotes = ["Thanks for the job you did", "Made my website look awesome online", "Took my business online"];
  var author = ["-Customer 1", "-Customer 2", "-Customer 3"];

  $('.button').click(function() {

    randomNum = Math.floor(Math.random() * quotes.length);





Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.