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 trialSamuel Igborgbor
4,335 PointsWhen i answer the second Task in the "write another program" task, it says "Oops! It looks like Task 1 is no longer pass
Task 1: <script src="scripts.js></script>
Task 2: <script> alert("Warning"); </script>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
<script>
alert("Warning");
</script>
</head>
<body>
<script src="scripts.js"></script>
</body>
</html>
3 Answers
Steven Parker
231,269 PointsI see two issues:
- the challenge did not ask for a
src
attribute to be added to the tag - the task 2 code should be added between the
script
tags already there from in task 1
When done, you'll have just one set of script
tags, located in the body, with no "src" attribute, and the code will be between them.
Evan Fishback
9,534 PointsHey there Samuel. You are very close! The two things going on in this challenge were:
- Task 1: Add Script Tag between the Body tag
- Task 2: Inside the Script tag write a function ....etc.
The script tag in the head element is not needed. Simply move your alert function between the script tags in the body and ditch the src = "script.js"
I hope this helps!
Samuel Igborgbor
4,335 PointsAlready figured it out. Thanks Steven and Evan