I’ve passed all of the tests for this project, however my tweet button doesn’t function properly… After watching a few videos I found how to use JS to attach the proper href to my tweet-quote button, but still can’t figure it out. I’ve tried both via
document.getElementById('tweet-quote').href = twitterLink
as well as
$('#tweet-quote').attr('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + quoteFormatted + authorFormatted);
I’ve found that both work outside of the getQuote function, however I have no way of (Or simply don’t know how to) accessing the current quote outside of the function’s scope. It works properly until I try to add the current quote (passing it in as a variable), which I then get redirected back to the pen. I
Still fairly new to many of these concepts so trying to figure out how to resolve my issues. Any direction or help would be greatly appreciated!
Ignore the terrible styling, I used aggressive colors so I could know that my styling was correct.
This is a link to my codepen: https://codepen.io/tazmancooks/pen/KKdEVbv
Your browser information:
User Agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.
Challenge: Build a Random Quote Machine
Link to the challenge: