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 trialFidel Zv
1,625 PointsI don't know how I am supposed to add an opening and closing script tag inside the body of the page. I'm a bit confused
This is what I did and it keeps telling me syntax error but have no clue how to fix it
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
<script>
alert("Here's another message from Treehouse");
<script>
</head>
<body>
<div class="container">
<h1>where to place your Javascript code.</h1>
</div>
<script src="scripts.js"></script>
</body>
</html>
3 Answers
Dylan Glover
2,537 PointsHey Fidel,
You are going to want to put your <script> tags inside of the <body> tags make sure the closing </script> tag is within the nest of the closing </body> tag. For this challenge you are doing inline scripting and don't need a link to your external javascript page.
It would look like this.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<h1>where to place your Javascript code.</h1>
<script>
alert("Warning!");
</script>
</body>
</html>
Piotr Manczak
Front End Web Development Techdegree Graduate 29,324 PointsBetween <body> and </body>
<script> alert('Warning!'); </script>
Fidel Zv
1,625 PointsThanks a lot Dylan