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 trial

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables Capturing Visitor Input and Writing It to the Page

Howard Bonds
Howard Bonds
2,459 Points

this question makes no sense? I have no idea why this wouldnt pass the test?

task 1 is no longer passing whwen I pass the data to the answer variable from the prompt question?

scripts.js
var answer = prompt('What day is it'?);
console.log(answer);                    
index.html
<!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>
Thas Eagans
Thas Eagans
Courses Plus Student 2,533 Points

Place the question mark inside quotes.

var answer = prompt('What day is it?');
console.log(answer);  

</TREagans>

3 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

There's a syntax error in your code

var answer = prompt('What day is it'?);

// should be this
var answer = prompt('What day is it?');

Task 1 (There are 3 Tasks) doesn't want you to pass a value to the variable, they only want you to define the variable.

Your code won't pass Task 3. You are using console.log() when the Task instructs you to use document.write().

Check your question mark.