Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
211,090 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.