I’ve been struggling with this button for a while. Right now I have the button working, but not entirely correct. When the page first loads, the quote isn’t stored within the twitter button for its initial ‘data-text’ value. I’m not sure why because when the page loads it should’ve already ran my randQuote() function which would’ve set $(‘share’).html() to something other than just blank text (which right now seems to be happening). Afterwards, when the user clicks the button, then $(‘share’).html() grabs onto the quote before the change. Is there something I’m missing in the order of the functions? My codepen is here: https://codepen.io/v13tindaw0rld/pen/MVQYZN
Any input would greatly be appreciated!