helpPls! Tweet button for random quote generator project

helpPls! Tweet button for random quote generator project
0

#1

Hello,
I am trying to generate a tweet from my random quote generator and I am stuck. Nothing happens when I click on the ‘Tweet this’ button. I read around and seems like I am doing what is commonly used:

document.getElementById("tweet").innerHTML = `<button id="tweet" onClick= "tweetQuote()"> Tweet this </button>`;
  function tweetQuote(){
    window.open("https://twitter.com/intent/tweet?text=" + quote +  "by - " + author);
  }

Can someone pls point out what I am missing. (Note: I have not made it responsive yet. Was working on functionality. pls ignore that); link https://codepen.io/remeklavya/pen/WZWOvX


#2

It seems to me that you are using the grave accent ( ` ) instead of an apostrophe ( ’ ) around the button-tag. Maybe that causes the problem?


#3

I have tried that. does’t fix the problem :frowning: