JSON Button Disappears - Random Quote Machine

I’ve made some progress with my random quote machine project, but whenever I click my “Get Quote” button to generate a new quote, the button disappears. I need to refresh the page to make it appear again.

It works properly when I take the section in the HTML out of my quote-container div class for some reason.

Here is the link to my codepen:


Can anyone point me in the right direction of why my button is disappearing, why taking it out of the div class fixes it, and how I can have the button stay there while also having it stay in my quote-container box?

Thank you!

It’s because button is inside your <div class="quote-container quoteMessage"> and you replace whole content of this div in $.getJSON on line 11

1 Like

Thank you so much! I’ve just turned it into two separate div classes and that fixed it. I also understand what the $.getJSON line was doing more now.