My code doesn't work
Here's my snapshot https://w.trhou.se/xqhjon7imn
I've spent two days trying to figure out whats wrong with my code. When I load my page and hit submit nothing happens. I've read other comments to try and figure out whats wrong but no luck. Please help me out I really want to understand this
Jennifer NordellTreehouse Staff
script.js inside the
java folder, but your folder is actually named
Java. To rename the folder, right click on it and then choose rename and type in the lower-case "java". Once this happens, your code will load, but if you look in the console you'll still see errors.
Many of these errors have to do with how you are naming things. For instance, many of your functions are defined using the snake case convention such as
my_function, but you are trying to call them using the camel case convention such as
mash_choice but then later try to call
mashChoice, but now JS can't find a function named
mashChoice. This is repeated a bit throughout your code.
Once you fix the naming conventions here, you will start receiving some results, but they still won't be correct. In your code you have this block:
var home = document.querySelector('#home'); // This says make a new variable and find the HTML tag that has the ID of "home" var profession = document.querySelector('#profession'); var hero = document.querySelector('#hero'); var location = document.querySelector('#location');
This code is selecting parts of the HTML with those IDs, but no such elements currently exist in your HTML file. I feel like the HTML file might have been altered at some point.
My best suggestion to you is to start correcting some of these issues and then make a new snapshot so we can help you troubleshoot further.
Hope this helps!
Wait a minute it works!!!! I had forgot to save it thank gosh for the the little red/orange dot that reminded me. BUT Jennifer you're the best!
Okay I came back to this changed the last Answers. I don't know what's wrong. (Screaming on top of a mountain). Thank you your amazing I will come back to this. I might have to start over.
Okay thank you I've made those corrections. I'm starting to think this will never work lol. I've looked at other codes to see if I've made any other drastic changes and can't find any. But I've made the corrections to the things you pointed out but still nothing happens I thin maybe I've missed a step. Thank you for the help that you've gave so far.