Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
i have been doing a lot of the videos per day and have forgotten how to put document.write into the html body.
the question asks me to use the document.write function to print the player variable onto the page and i have forgotten how to do that.
var player = 'Jasmine'
Steven Parker217,569 Points
Any function call is just the name of the function followed by parentheses. Any argument(s) passed to the function go between the parentheses:
title = "<h1>This is a title</h1>"; document.write(title);
Justin Hicks14,290 Points
The body is the document object. So .write is a method on the document object. When you call document.write(); it’s 100% going to print out to the body because the body is part of the document object.
Just put in document.write(player); in the app.js file and you will see from that point it will click.