Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAimee Kiernan
2,576 PointsOnce 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
Aimee Kiernan
2,576 PointsHere is the snapshot: https://w.trhou.se/3w347q5m30
1 Answer
KRIS NIKOLAISEN
54,972 PointsI may have changed too much but the basic problem has been resolved
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.
KRIS NIKOLAISEN
54,972 PointsKRIS NIKOLAISEN
54,972 PointsTo share your workspace create a snapshot. It is the camera icon in the upper right corner.