Having trouble with the Random Quotes Generator

Having trouble with the Random Quotes Generator
0

#1

Hello,
I’ve been working on the Random Quotes Generator and I can’t see to figure out how to reset the value of my span when generating another quote. I didn’t see anyone else on the forum with that problem. They just keep piling one after the other every time I click on my button. I didn’t think it was gonna hard to fix but I just can’t find a way to do it. I’m new to this so my code might seem retarded haha !
Here is my CodePen.

Thank you !


#2

You can clear the containers first before calling insertAdjacentHTML with quoteContainer.innerHTML = '';.

Or you can just use innerHTML instead of insertAdjacentHTML to output the quotes.

quoteContainer.innerHTML = quoteString;

#3

Oh thank you so much !
I actually tried .innerHTML but i just realized i was doing .innerHTML(quoteString) instead of .innerHTML = quoteString…!