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
207,979 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.