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

rdaniels
rdaniels
27,258 Points

Code Challenge: Your first JavaScript Program

inside the script tags I put: <script>

document.write(<p>Welcome to JavaScript</p>);

</script> but I keep getting a parse error... and I can see in the editor that the closing p is showing an error. Any help would be appreciated

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Rodney,

There are a couple of errors. First one is a syntax error: You are missing your quotation marks needed to enclose the sentence.

The second one isn't really an error in syntax, just an error in what the challenge is asking for. The challenges are picky. You wrote "Welcome to JavaScript", but the challenge wants "Welcome to my site"

The corrected line of code will be

document.write("<p>Welcome to my site</p>");

Keep Coding! :)

rdaniels
rdaniels
27,258 Points

Thank you! Exactly right!

Colin Bell
Colin Bell
29,679 Points

You have to put "<p>Welcome to JavaScript</p>" in quotes;

document.write("<p>Welcome to JavaScript</p>");