Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<h5>Simple Quote Generator</h5>
<p id = "QuoteDisplay"></p>
<button id="new-quote-btn">New Quote!</button>
 
var quotes = ['Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared.','Happiness is the art of never holding in your mind the memory of any unpleasant thing that has passed.','To be happy, we must not be too concerned with others.','Change your thoughts and you change your world.','hello'];
function newQuote(){
    var randomNumber = Math.floor(Math.random()*quotes.length);
    $("#QuoteDisplay").text(quotes[randomNumber]);
}
$('#new-quote-btn').click(newQuote)
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers