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

script tags

I have been taking the script tags quiz and I can pass the first test but when I take the other witch is about adding on to the script tags with a Warning alert the warning alert works but it says that now the first test is wrong so I go back and it told me I had too many script tags

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="javascript.js"></script>
  <script> 
    alert("Warning"); </script>
</body>
</html>

3 Answers

Neil Docherty
Neil Docherty
10,418 Points

When the code challenge only asks you to create a "pair of script tags" it means

<script></script>

In the second part you just put in your alert message.

Working solution:

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>


  <script>
  alert("Warning");
  </script>
</body>
</html>
Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Neil is correct.

Part 1 of challenge:

<body>
  <script></script>
</body>

Part 2 of challenge:

<body>
  <script>alert(Warning!)</script>
</body>

The challenge does not ask you to put in a script src, that is why it is not letting you pass. If you add (or take out) something from the challenges, it will return an error and say you are incorrect.

Hope this helps. Keep Coding! :)