JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

V School Learning
V School Learning
21,744 Points

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.

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>

<body>
</body>

<script>
// Write your code here.
document.write
</script>

</html>
Michael Williams
Michael Williams
Pro 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
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Torben Korb
Front End Web Development Techdegree Graduate 88,462 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.