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 trialzachary wilborn
1,557 PointsI am using the document.write() statement but it is saying that i am not. i use document.write(player);
tell me what i am doing wrong please.
var player = 'Jasmine'
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
document.write();
<script src="app.js"></script>
document.write()
</body>
</html>
3 Answers
Peter Vanderlind de Oliveira
7,376 PointsThe first task should be:
var player = 'Jasmine';
You didn't type the ; symbol
The second task you just add:
document.write(player);
One last thing, you're supposed to do everything inside the app.js tab, that's where the javascript code is placed, you used document.write() inside the index.html tab. It won't work because it's a different language.
Moses Finlay
Full Stack JavaScript Techdegree Graduate 24,800 Points- Line 8 and 10
document.write();
is outside thescript
tags. Notice I have removed it. - Notice I have added
document.write();
inside the script tags. - This piece of code
var player = 'Jasmine'
needs a ; a the end.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="app.js">
document.write(player);
</script>
</body>
</html>
zachary wilborn
1,557 Pointsi had the syntax correct. i just never put it inside the script. thanks
Moses Finlay
Full Stack JavaScript Techdegree Graduate 24,800 PointsYou are welcome :)