Hi. I think I’ve followed the instructions but It doesn’t work I don’t know way. Could anybody help me?. I have placed the code in CodePen. By the way, I’m new to CodePen as well so I don’t know how to provide you with the links and so on. But I will try. My user name is Amapola Negra. Thanks in advance.
if(customName.value !== '') what will happened if the user did not provide any data to the customName input ;)
you defined let newStory= storyText; inside the if statment block that mean it does not exist outside that block
that why when you try to access it later it show it as undefined
go to the developer tool in your browser and check the console tab and you will see that it report it not defined
if(document.getElementById("uk").checked) this will work in case if the user was in us then change it to uk but if the user decide later to change from the uk back to us it will still show the uk version
there 2 copy of “:insertx:” in the text so you need to replace both of them
you can use same replace(it replace the first occurrence only) method twice or check this one
try to fix those and if you find anything from the output that i missed try to fix it also
always check the console when use js code it help alot and you can use
console.log( write any value or string or variable here) and it will print it to the console so you maybe use it to check if the if condition work or the value of certain variable calculated as it should be