Help: Twitter button on Random Quote Machine opens codepen in new window

Help: Twitter button on Random Quote Machine opens codepen in new window
0

#1

Looking for some support:

When I use the Twitter button for my random quote machine it opens up another tab with the random quote machine in it instead of twitter. Any suggestions for fixing this would be greatly appreciated.

Codepen


#2

That is because the button has:

href=""

so it just goes opens another window of the same page it was on previously.


#3

The anonymous function in the following line never runs, because you do not have an element with the id of “newQuote”.

$("#newQuote").on("click", function(){

plus the entire code block associated with this line above needs to be moved outside of the function called newQuote.


#4

Thank you, RMDawson. After you pointed this out I was able to get the twitter button working correctly.