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 trialmohamedahmedgehad
11,541 Pointsdocument.write(); Is not displaying
No message is displayed with the code
3 Answers
Steven Parker
231,271 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
231,271 PointsSteven Parker
231,271 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.