JavaScript Treehouse Club - MASH MASH - JavaScript Stuff You Can Change

Aimee Kiernan
Aimee Kiernan
2,576 Points

Once I click the "tell my fortune" button, div doesn't appear as I expect.

Hey Guys,

I have tried to change quite a bit of code to allow for my own version of this game. I have managed to get the "tell my fortune" button to work however once clicked it doesn't come up with the div I am expecting. It just comes up with a random selection of my Var words, either "country", "skibuddy", "skis" or "machine".

I cannot work out what I have done wrong, or how to fix it. Any help would be greatly appreciated!

Here is my current workspace: https://teamtreehouse.com/workspaces/40590957

KRIS NIKOLAISEN
KRIS NIKOLAISEN
Pro Student 47,300 Points

To share your workspace create a snapshot. It is the camera icon in the upper right corner.

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 47,300 Points

I may have changed too much but the basic problem has been resolved

https://w.trhou.se/lrax2ccg4g

mash is the id of the form itself.

var mash = document.querySelector('#mash');

when you update the html of mash the div (and the original form contents) no longer exist. So what you are seeing is a form with the random text and nothing else.