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 inside HTML

I wrote the script tag with the opening and closing script tags, and the alert within the script tags; however, I still seem to be having an issue with my code. Is there something I am missing?

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

</body>
</html>

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/main.css"> <title>JavaScript Basics</title>

</head> <body> <div class="container"> <h1>Where to place your JavaScript code.</h1> </div>

<script src="scripts.js"> alert("Hey, you're back for more?); </script> </body> </html>

1 Answer

Steven Parker
Steven Parker
231,271 Points

There doesn't appear to be any script tags in the code shown above.

Give it another try, and remember these will be plain script tags (no "src" or other attributes).

Sorry, I thought it would copy my code from my workspace but somehow it didn't get the latest version.

I tried it again like you suggested and it's still not correct.

Below is my code:

'''html <script></script> '''

Steven Parker
Steven Parker
231,271 Points

I'm not sure what the "html" part is there (perhaps an error?), but the start and end tags should go on line 9, inside the body area.