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 trialShadrach Thomas
Courses Plus Student 8,915 Pointsdocument.write()
do know how to solve this
var answer = prompt("What day is it?");
var document.write('smack');
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="scripts.js"></script>
</body>
</html>
2 Answers
Thomas Fildes
22,687 PointsHi Shadrach,
You will use document.write to write the answer variable with the following code:
var answer = prompt("What day is it?");
document.write(answer);
Hope this helps! Happy Coding!!!
Chris Jardine
13,299 PointsHi Shadrach
You have to use the method document.write(), it's not a variable, so take the "var" before document.write(). Then you need to call the variable answer:
var answer = prompt("What day is it?");
document.write(answer);
Shadrach Thomas
Courses Plus Student 8,915 PointsShadrach Thomas
Courses Plus Student 8,915 Pointsplease how can i just skip to the real deal i think the way the trial is treating me is not fair i do get somethings right but end up failing it not cool, i really want to learn how to code so good
Thomas Fildes
22,687 PointsThomas Fildes
22,687 PointsIt is perfectly natural to be hit with a loss of confidence when struggling with challenges. This is called Imposter Syndrome. You can overcome it by not worrying that you fail challenges and that mistakes make us successful in coding.
Keep at it and you will learn from these mistakes to be great at writing code. Every developer makes mistakes!
Pace yourself through the track/course gradually and you will pick it up :)