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

Jeff Bryant
Jeff Bryant
79 Points

Add code inside the <script> tags to write the words "Welcome to my site" onto the web page.

What do I do

Ryan Boone
Ryan Boone
26,518 Points

Please post the code you're having trouble with.

The script tag is typically where you either link to another JavaScript file (using the src attribute) or write your own JavaScript code in page.

To write the words "Welcome to my site" on your page, you will want to add HTML tags within your body element. Something like this...

<body>
    <h1>
        Welcome to my site.
    </h1>
</body>

Hey Colin,

This specific challenge is asking the user to utilize the write method (This is a JavaScript course).

2 Answers

To write to the document in JavaScript, we use:

document.write("This is an example.");

I'd recommend re-watching the video on writing your first JavaScript program.

Jake Lundberg
Jake Lundberg
13,965 Points

use document.write() to print the text onto the page. You will place this within the <script></script> tags.

Hope this helps!