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) Introducing JavaScript Your First JavaScript Program

why is this asking for answers to something that wasn't even taught??

this is wanting me to write a phrase between script tags in html when I'm trying to learn javascript. None of this was even gone over and it's wanting a document.write function!?!? I have no idea what its even asking for.

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>


// Write your code here.

Michael Williams
Michael Williams
Courses Plus Student 8,059 Points

Hey V School Learning. Without knowing what the question is in the challenge, I'm not sure how to help. But they do talk about the document pretty extensively in the JavaScript and Dom course. Think that might be what you're looking for. If not, I'd let them know at support, as this wouldn't be the first code challenge where this has happened.

2 Answers

Torben Korb
.a{fill-rule:evenodd;}techdegree seal-36
Torben Korb
Front End Web Development Techdegree Graduate 91,237 Points

Hi V School Learning, the question asked is to write some JavaScript code into the script tag inside the given HTML document. To render content on a webpage is common practice. The previous video to the challenge shows exactly what needs to be done here. Even when you generally should avoid using document's write method and better use more secure and performant alternatives in production. The point here is to start simple and have some basic code, that shows any effect on a given webpage. Also if you never considered to use JavaScript in a front-end webpage this practice is so common as JavaScript is the standard of the web along HTML and CSS.

Nevermind sometimes the questions to the challenges are a bit off and it's better to read the question word by word. Also this forum is really helpful for questions directly coupled to the courses and you'll get help.

Anyway back to your question: just follow up the previous video again and do exactly what Dave's demonstrating there. Just with the given string from the challenge and without the h1 markup from the video. Just a plain string in quotes. Open up your console in your browser and watch if there are any errors you getting, which could help you more to locate possible errors.

Hope this helps. Good luck!

Óscar Hernández sandoval
Óscar Hernández sandoval
9,257 Points

you should try something like inside the javascript: <script> document.write("Hello World!"); </script> you can verify in firefox or chrome console how is displayed.