Tweeting quote from quote machine

I’m trying to complete the project without using any jQuery. Even though I have repetitive code blocks, I’d like to see it get done this way, if possible, using vanilla JS to do the manipulations…

So far it’s gone fine. But I’m having trouble with the tweet button since it seems that for some reason by the time it reaches that part of the code, my quoteSpan.textContent is empty so I can’t edit the tweet’s href.

Any advice? Or can’t this be done? :slightly_frowning_face:

Project link.

Hey,

Not sure what you mean, but i just got tweet button by id and set its href and target after setting textContent using randQuote and randQuoteAuthor and it works fine

No act of kindness, no matter how small, is ever wasted.

:slight_smile:

Looking at the code (as a newb, sorry), I’m not clear what quoteSpan refers to in the eventListener function. Maybe try “getting” the element from the dom in the function again? Or–and this is just throwing stuff against the wall–maybe try passing by reference and seeing what happens?