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 Write Another Program

<body> <script src="=scripts.js"></script> <script> alert("Warning");</script> I am stuck at the above code.

From the above code which is from JavaScript Basics, i get stuck and i am receiving a message that Task 1 is no longer passing. Then there is a command box above that says "Go to task one", after that i still can't move forward to the next challenge

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
  <script src="=scripts.js"></script>
  <script>
    alert("Warning");</script>
</body>
</html>

5 Answers

Jazz Jones
Jazz Jones
8,535 Points

You have two script tags, and only need one. You don't need the script tag that points to (in this case) a nonexistent javascript file. You just need the script tag that opens the alert box

I did that too. It was correct but I can't move forward to the next task. It takes me back to task 1

Jazz Jones
Jazz Jones
8,535 Points

Restart the code challenge and when it asks you to put in the script tags, don't put in <script src="scripts.js">. Just leave it as <script></script>

Ok. Thank you

I need to include the message 'warning' inside the script tag, do I put it in between the ><, or do I create a different line for the alert message?

I think I got it, the alert goes in between the ><