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 Link to an External Script

Inside the file

HI.

I canΒ΄t figure it out how I place the alert code inside the file. Can someone explain it for me :)?

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="shout.js"></script>
  <Script>
    alert("I DID IT");
   </script>  
  </body>
</html>
shout.js

3 Answers

You mean over the shout.js file ?

Thank you for answering me:)

Rochell Hill
Rochell Hill
10,677 Points

At the top there are 2 tabs....click on the shout.js tab and a new empty file shows up, you will add the alert in that file. It is tricky because they don't tell you there are 2 files on that exercise: index.html and shout.js

Thank you:) Now I have understand it :D

Rochell Hill
Rochell Hill
10,677 Points

Click on the tab (at the top) for the shout.js file...then put your alert in that file, not in the html file. Delete the following also. (and be careful about capitalizing <Script>...keep it lower case when you type tags). <Script> alert("I DID IT"); </script>

Happy coding!