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

Woodley Fevrius
Woodley Fevrius
184 Points

Javascript basics question

Can't seem to figure out this code task. I do the first task fine but every time I do the second one it tells me that now the first one's wrong. Not sure what I'm doing wrong here.

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

2 Answers

Steven Parker
Steven Parker
231,236 Points

I get a different message.

I pasted your code in for task 2 and got: *"Bummer! You didn't call the alert() function inside the <script> tags."

This makes sense as the objective of task 2 is "write a function that will open an alert dialog with the message 'Warning!'", and that hasn't been done yet.

Also, no matter how you spell it, you don't need an attribute in the script tag for this challenge.

<script scr="scripts.js">alert("Warning!")</script>

Steven Parker
Steven Parker
231,236 Points

But as I said before, you do not need an attribute in the script tag! And as Robert pointed out, "scr" is not a valid attribute anyway.