Random Code Generator Window problem

Hi there, I’ve been playing around with the Random Code Generator exercise and have come up with something (link below).
The problem is that; whenever I click on the tweet button; the tweet window opens and everything works fine but my content in the original html page disappears.
Refreshing the page would make the html content reappear.
I’ve tried location.reload() whenever I click the tweet button but this does not seem to solve the problem.
Could anyone explain to me why this happens and how to fix it??
Thank you!

See the Pen randomquotegeneratorfromICNDB by Cavacado (@cavacado)