elslamo alikom @Dev2
first you can use replaceAll which replace all the occurance of the word in the string instead of calling replace twice as you did
and you should replace “:insertx:” but you replaces “insertx”
you should make the code for getting random string inside the function result
so be like that
function result() {
let newStory = storyText;
let xItem = randomValueFromArray(insertX);
let yItem = randomValueFromArray(insertY);
let zItem = randomValueFromArray(insertZ);
newStory = newStory.replace(':insertx:', xItem);
newStory = newStory.replace(':inserty:', yItem);
newStory = newStory.replace(':insertz:', zItem);
newStory = newStory.replace(':insertx:', xItem);
you misstype in this line
if(customName.value != '') {
newstory.replace('Bob', customName.value)
}
it should be newStory and also you need to write this
newStory = newStory.replace(‘Bob’, customName.value) ;
as string in js is immutable that you can not edit it you so the calling to replace just return a new string after the replacing
also in this
if(document.getElementById("uk").checked) {
let weight = Math.round(21.4286) + ' stone';
let temperature = Math.round(34.4444) + ' centigrade';
newStory.replace('94 fahrenheit', temperature);
newStory.replace('300 pounds', weight)
}
you missed the newStory = and so on
when you get those kind of issue try to right click the page then look into the console it help alot to know what is going on
and you can use console.log(you can write variable name here or anything you want to print)
to debug the code by print the value of certain variable to the console to check if it print the value as it should be or not
hope that help and have a nice day 