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.

mohamedahmedgehad
11,541 Pointsdocument.write(); Is not displaying
No message is displayed with the code
3 Answers

Steven Parker
220,464 PointsBe aware that anything done by "document.write();
" will only be seen after the program finishes. If you need to see messages while the program is running, use "alert
" or "console.log
" instead.
If that's not the issue and you're still having trouble, please show your complete code.

mohamedahmedgehad
11,541 Pointsvar aswer = prompt(" What programming language is the name of a gem?"); if ( answer === 'Ruby') { document.write("<p>That's right!</p>"); }

mohamedahmedgehad
11,541 PointsThank you so much
Jamie Reardon
Treehouse Project ReviewerJamie Reardon
Treehouse Project ReviewerGreat reply Steven Parker! :)
Steven Parker
220,464 PointsSteven Parker
220,464 PointsIn the example the variable created is named "
aswer
", but it's referred to as "answer
". So the test was never true.Either one will work, but they must be the same.