title: Send random quote with tweet button click in Jquery
body: <p>I am doing a "Random Quote Machine" which takes random quotes from and stored array and let the user tweet it. I have created the random quote generator but not able to tweet the same. Need some help with tweet button.</p>
  
  <p><strong>My Jquery</strong></p>
  
  <pre><code>var quote = new Array()
  quote[0] = 'this is first quote'
  quote[1] = 'this is second quote'
  
  function tweet() {
  window.open('https://twitter.com/intent/tweet?hashtags= freecodecamp&amp;text='   + encodeURIComponent($(".message").html(quote[randomquote]));
  }
  
  
  $(document).ready(function() {
  $("#getMessage").on("click", function(){
    var randomquote = Math.floor(Math.random()*(quote.length-1));      
    $(".message").html(quote[randomquote]);      
  });
  
  $('#twitter-share-button').on('click', tweet)
  
  })
  </code></pre>
  
  <h2>Bit of html</h2>
  
  <pre><code>&lt;div class = "col-xs-12 well message"&gt;
    &lt;h3&gt;Click to get Random Quotes&lt;/h3&gt;
  &lt;/div&gt;
  &lt;button id = "tweetMessage" class = "btn btn-default btn-lg" target="_blank"&gt;&lt;i class="fa fa-twitter fa-fw"&gt;&lt;/i&gt; Tweet it&lt;/button&gt;
  &lt;button id = "getMessage" class = "btn btn-default btn-lg"&gt;&lt;i class="fa fa-fire fa-fw"&gt;&lt;/i&gt; Get Quote&lt;/button&gt;
  </code></pre>