Hi Steph1 , you’re welcome.
I had another look at your pen, tweetButton.createElement(‘a’) within your function generateTweetButton, line 47 in your js file, is causing an error, to see that you will need to open dev tools/web console on whichever browser you are using.
You reasoning is nearly there, rather than create an element on another element (not allowed and the reason for the error), you need to first create a new element and then add it to the document. There are many methods to add an element to the document.
eg:
var x = document.createElement("A");
x.href = "https://google.com";
x.text = "This link will open google search";
document.body.appendChild(x);
In your approach so far, it looks like you want to dynamically replace the existing “a” element when a new quote is generated.
This reference might be worth a read:
[https://developer.mozilla.org/en-US/docs/Web/API/Node/replaceChild](http://MDN: replaceChild())
You might also consider how you are targeting the element you want to change. Is “tweetButton” returning what you expect/want?
I sometimes find it difficult to debug within codepen, so I created this from your code.
[https://repl.it/@phatbhoy67/NextDisfiguredForm](replit link)
I’ve added some comments in the js file [index.js, under the list of files on the left hand side] which I hope you will find helpful.
You need to click “run” to get started I think.
Feel free to fork it and change it up etc.
If anything doesn’t make sense or you get stuck, reply and I will try my best to help.