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 The Console Challenge

Do I need to place script tags around the console.log("message"); commands?

If I don't use script tags, the "console.log("message");" shows up on the webpage. But Dave didn't say to use them - 1) do I need to use them, and 2) if not, how do I get the text of the command NOT to show up on the page? Thanks!

Figured it out! I realized that I was inputting the console.log command into the html file, not the javascript file!

2 Answers

Steven Parker
Steven Parker
229,644 Points

Congratulations on resolving your own issue. :+1:

As you discovered, you can put JavaScript code in your HTML file using <script> tags, but for anything substantial it's much better to have a separate file and load that from the HTML.

Mohammed Munier Hamoud Shikh
Mohammed Munier Hamoud Shikh
1,616 Points

Yes, you must put els ""or ''if you want to print a String (Text).But later you will see that we are able to print the content of the variables.