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 trialJohannes Halvorsen
7,630 PointsWhere is the "html" variable declared?
I can't find the line where the "var html" is! Is this a mistake?
1 Answer
Jonathan Grieve
Treehouse Moderator 91,253 PointsTo solve this, I'd do var html
at the top of the file with the rest of the declared variables. See if that works.
Once you declare a variable you don't need to use the var
again when assigning its value.
But there is a reason the script should be working.
What's happening with the HTML variable is it's being displayed using the print()
function. Variable is passed in as an argument and the method itself looks for a place in the browser to display that message. :-)