Stuck in Random Quote Machine

Hi guys!

I was building my RandomQuoteMachine and ran into some problems. Each time when I clicked the tweet button, the original webpage just turned blank. I have tried many methods but still havn’t found the real cause. Please help me to find it!!

Millions of thanks!

Here’s my codepen link: https://codepen.io/Alexsunnik/pen/mjMgaN

You can stop the default behavior by using event.preventDefault(); in your event handler or having the last line be of handler as return false; .

Your anchor is not really navigating so much as it is acting as a button so when clicked it “navigates” to this blank page

Of course I will add his name . The project has not been completed yet, and I prefer to do the commenting job in the end. So do you know what’s the cause for that problem?:sweat_smile:

His method works! Thanks to both of you!

Thanks for your reply. It’s very helpful. :grinning: