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

Lindsey Morse
Lindsey Morse
2,022 Points

Not sure why my code is Wrong?

Hello, I am new to JavaScript and I am not sure what I am doing wrong in this task? The code appears to be working on my screen, but it is saying that this is making task 1 no longer work.

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>

2 Answers

Delete the <script src="scripts.js"></script> line and you're good.

William Tan
William Tan
5,148 Points
// This part of your code links to an external JS file. 
<script src="scripts.js"></script>

The required answer is to Step 1. "Add opening and closing script tags inside the body of the page." Step 2. "Add alert"