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

Brandon Schneider
Brandon Schneider
1,812 Points

Use the document.write() method to write the variable answer to the page.

please help me

scripts.js
var answer = prompt ("What day is it?");
documant.write (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>

1 Answer

Matt Hanson
MOD
Matt Hanson
Treehouse Moderator 17,058 Points

Hey Brandon, you're very close.

Two small things:

  1. You've misspelled document as 'documant'

  2. There should be no space between function names and the parentheses

var answer = prompt("What day is it?");
document.write(answer);

Happy coding!