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 fucntion

I am not sure what is going on here. the dialogue box opens up on my quiz but the code quiz says its wrong!

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="scripts.js"<></script>
<script>
  alert("Warning!")
</script>
</body>
</html>

2 Answers

Steven Parker
Steven Parker
231,236 Points

:point_right: Here's a few hints:

  • this challenge expects only one set of script tags, not two
  • for the purpose of this challenge, you won't need any attributes in the opening script tag
  • you first set of script tags has an extra < character inside the opening tag

While it's good practice to end your JavaScript statements with semicolons (;), it's not necessary on the last statement in a block, or for the sole statement in this challenge.

Based on what the challenge is asking you can remove this tag:

<script src="scripts.js"<></script>

also make sure to use a semi-colon after the closing parenthesis

<script>
  alert("Warning!");
</script>