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 trial
Edgar Gil
13,322 PointsJavascript code not working help?
When the user click the "Action' button, text should appear on the text field writing "Type your action here" but nothing is working, I wrote the same thing Jim Hoskins. But im not geting same result as him.
Link to hes video http://teamtreehouse.com/library/javascript-foundations/functions/examples
Link to my code
Btw don't mind the CSS, I have a thing for the color GOLD.
2 Answers
Erik McClintock
45,783 PointsEdgar,
You have a capitalization error. You have 'document.GetElementById()', you need 'document.getElementById()' (i.e. do not capitalize the G).
Erik
Edgar Gil
13,322 PointsWow, can't believe this. I need to upgrade my problem solving skills. Thank you
Erik McClintock
45,783 PointsThese are the most common and most difficult to spot types of errors; it's not just you by a long shot! Even veteran programmers will run into these problems and can get stuck trying to debug them for hours. Spelling mistakes, missing punctuation, capitalization errors, etc. are all very tricky to hunt down, especially when you're so close to the code. That's where an extra set of eyes can help :)
Happy coding!
Erik
Edgar Gil
13,322 PointsThank Erik! But what really got me confuse was the "JSHint" in http://jsfiddle.net/qgkkpmy4/ . Because when i click on the JSHint I get :
JSHint Valid! Close window Good work! Your JavaScript code is perfectly valid.
So i got me really confuse as to why is not working when the Hint is telling me everything was fine. But i keep my eye open for next time. Thank you!
Travis Thompson
12,976 PointsTravis Thompson
12,976 PointsHello Edgar Gil,
Looks like you simply mistyped your document.getElementById as document.GetElementById. Javascript is not forgiving for these issues, and can drive you crazy. I would advise checking the console for errors when things are not working.
I've corrected it below.
Best, Travis Thompson