Html tag showing in my quote sent to twitter

Html tag showing in my quote sent to twitter
0

#1

Hi All

I have just completed my random quote machine, but I am not able to prevent the
tag from being sent with the quote to twitter.

My codepen page below:


What I forgot to say was that when you click the tweet button it sends the quote to your twitter page. It is this quote which contains the
tag.
thanks


#2

That makes sense since you pass the result to totalResult(). Twitter is parsing the tag as a string. What you want to do instead, is pass the value to totalResult() and create different strings for your $("#page").html() and twitPost();


#4

Thanks guys,

Your solutions fixed my problem. I just need to logically work through them to understand how it is different from what I did initially, and how it fixed the problem when mine could not.