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 trialnechama Avikasis
64 PointsI don"t understand why my script isn't working, can you help?
I got a notification saying that i wrote 'script' too many times, and i don't under stand what i did wrong
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="learning to code.js"></script>
<script> alert(" how are you doing?");</script>
<script>document.write("<h1>write your message here<h1>");</script>
</body>
</html>
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! On step 1 of the challenge you are to add only an opening and closing script element. Your code contains three script elements. On Step 2 of the challenge you are supposed to add an alert with the text "Warning!". One of your script elements has an alert, but the text doesn't match exactly what the challenge asks for.
Note that challenges are very exacting and require you to follow the instructions to the letter. Even code that may be fully functional outside the challenge may cause the challenge to fail if the precise requirements aren't met. Thus, it is always a good idea to try not to do anything the challenge doesn't explicitly ask for.
Hope this helps, but let me know if you're still stuck!