Q Random Quote Generator renderHTML

Q Random Quote Generator renderHTML
0.0 0

#1

Hello,

I need help finding a method on how to replace html txt in my renderHTML function.
I am using currently using insertAdjacentHTML(‘beforeend’, htmlAuthorString); method and it is appending the string after the previous one and that’s incorrect.

I tried .replaceWith method and it replaced successfully once. then it got stuck… and quit working.
/quoteMessage.replaceWith(htmlQuoteString);
authorName.replaceWith(htmlAuthorString);
/

I tried .remove prior to insertAdjacentHTML but it removed the whole thing. It doesnt even append afterwards.

My source code:


#2

Use el.innerHTML = ‘stuff to be parsed’


#3

Thank you. it works :slight_smile: .
quoteMessage.innerHTML = htmlQuoteString;
authorName.innerHTML = htmlAuthorString;