Assesment wanted for Silly story generator

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.

Regards

Hello @mamenchuweb

go to your codepen and and send us the link for the project it the same link you see in the address bar of your browser when you navigating to it

hope that help and have a nice day :slight_smile:

Hi. Thanks in advance. Here you have the link https://codepen.io/amapola-negra/pen/abJbdEN.

Regards :slight_smile:

you very welcome

here are the issue

  1. if(customName.value !== '') what will happened if the user did not provide any data to the customName input ;)

  2. 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

  3. 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

  4. 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

hope that help and have a nice day :slight_smile: