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!
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
Check this out, I have these two files.
This web page:
<!DOCTYPE html> <html> <head> <title>Welcome to Treehouse Code Challenges!</title> </head> <body> <h1>Greetings!</h1> <p>This is a webpage from inside a code challenge</p> <script src="js/app.js"></script> </body> </html>
And this .js file:
When I click Preview in the code challenge, the web page that is displayed says this:
Greetings! This is a webpage from inside a code challenge
But it does NOT say "Hello, World!"
I was just wondering, How come the web page doesn't say "hello world" anywhere?
Niclas Hilmersson8,296 Points
console.log doesn't print the message Hello World to the actual page. console.log prints a message in the console of the page. I Think he mentions that earlier in the video. Go rewatch and see if you can find how to access the debug console for the webpage and you should be able to find it printed there.
prints to console (ctrl + shift + i (chrome) or ctrl + shift+ k (firefox));
To display on page use "document.write";
document.write ('Hello World');