title: Twitter share button - content from a variable
body: <p>I have these quotes randomly passed to the paragraph via variables when "a new quote" button is cliked. </p>
  
  <p>I want a user to have an ability to share the current loaded quote on twitter.
  I tried setting "data-text" attribute's value to equal the current variable, but it doesn't seem to work.
  My code so far:
  <a href="http://codepen.io/RycerzPegaza/pen/YypZza" rel="nofollow">http://codepen.io/RycerzPegaza/pen/YypZza</a></p>
  
  <p>// HTML //
      </p>
        </p>
  
  <pre><code>    &lt;ul id="tweet"&gt;&lt;a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-text=""&gt;share the quote&lt;/a&gt;&lt;/ul&gt;
  
    &lt;ul class="pager"&gt;
      &lt;li onclick="randomquote()"&gt;&lt;button type="button" class="btn btn-default"&gt; a new qoute&lt;/button&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/nav&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;
  </code></pre>
  
  <p>// JAVASCRIPT //</p>
  
  <pre><code>// Twitter script
  !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
  //
  
  // RANDOM BACKGROUND
  
  randomcover = function(){
  var covers = [];
  covers[0] = " #222 url('http://i147.photobucket.com/albums/r293/VIEWLINER/REED/RFGF02.jpg~original') no-repeat center center fixed";
  covers[1] = " #222 url('https://farm6.staticflickr.com/5255/5419581943_5826526eb4_o.jpg') no-repeat center center fixed";
  covers[2] = " #222 url('http://www.splitshire.com/wp-content/uploads/2015/09/SplitShire-6272.jpg') no-repeat center center fixed"
   // FADE IN EFFECT 
    $("li").click(function() {
     var aCover = covers[Math.floor(Math.random()*covers.length)];
    $currImg = $("body").css({background:aCover})
    });
  };
  // QUOTE MACHINE
  randomquote = function() {
    var quotesArray = [];
  quotesArray[0] = "One day I will find the right words, and they will be simple. &lt;br&gt; ― Jack Kerouac, The Dharma Bums";
  quotesArray[1] = "Live, travel, adventure, bless, and don't be sorry. &lt;br&gt; ― Jack Kerouac";
  quotesArray[2] = "My fault, my failure, is not in the passions I have, but in my lack of control of them. &lt;br&gt; ― Jack Kerouac";
  quotesArray[3] = "the only people for me are the mad ones, the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn like fabulous yellow roman candles exploding like spiders across the stars. &lt;br&gt; ― Jack Kerouac";
  quotesArray[4] = "The only truth is music. &lt;br&gt; ― Jack Kerouac";
  quotesArray[5] = "The best teacher is experience and not through someone's distorted point of view. &lt;br&gt; ― Jack Kerouac";
  quotesArray[6] = "Great things are not accomplished by those who yield to trends and fads and popular opinion. &lt;br&gt; ― Jack Kerouac"; 
  quotesArray[7] = "Don't use the phone. People are never ready to answer it. Use poetry. &lt;br&gt; ― Jack Kerouac";
  quotesArray[8] = "Will you love me in December as you do in May?&lt;br&gt; ― Jack Kerouac";
  quotesArray[9] = "My witness is the empty sky. &lt;br&gt; ― Jack Kerouac";
  quotesArray[10] = "Maybe that's what life is... a wink of the eye and winking stars. &lt;br&gt; - Jack Kerouac";
  quotesArray[11] = "All human beings are also dream beings. Dreaming ties all mankind together. &lt;br&gt; -- Jack Kerouac";
  quotesArray[12] = "Forgive everyone for your own sins and be sure to tell them you love them which you do. &lt;br&gt; - Jack Kerouac";
    quotesArray[13] = "Because in the end, you won’t remember the time you spent working in the office or moving your lawn. Climb that goddamn mountain. &lt;br&gt; - Jack Kerouac";
    quotesArray[14] = "So therefore I dedicate myself, to my art, my sleep, my dreams, my labours, my suffrances, my loneliness, my unique madness, my endless absorption and hunger because I cannot dedicate myself to any fellow being. &lt;br&gt; - Jack Kerouac";
    quotesArray[15] = "Never Say a Commonplace Thing. &lt;br&gt; - Jack Kerouac";
  
   var newquote = quotesArray[Math.floor((Math.random()*15))];
        document.getElementById('content').innerHTML = newquote;
        document.querySelector(".twitter-share-button")[0].setAttribute("data-text", newquote);
      };
  </code></pre>