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

Arlind Nushi
Arlind Nushi
2,643 Points

Task 2, Challenge 2 problem

Hi there, when i add the code:

<script> alert('Warning'); </script>

inside body tag, it didn't take that as correct answer, i don't know what is wrong there.

Thanks

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script>
alert('Warning');
</script>
</body>
</html>

6 Answers

This passed:

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script>
  alert("Warning!");
  </script>
</body>
</html>

I think you had to have exclamation mark in your warning.

It's stupid to get stuck because of grammar error etc. but it happens at times. Your code was correct.

Happy holidays and happy coding!

Could you post a link to the challenge, please?

Thanks, I'll take a look and try to find the problem.

Arlind Nushi
Arlind Nushi
2,643 Points

Wow, i'm embarrassed by that, how i did'n see that "!" hahaha, thank you mate for the help.

Happy holidays to you too :)

Don't be embarrassed. It happens to me all the time too. You get code-blind when trying to learn new stuff and the last thing you'll think is the missing exclamation mark or other stupid stuff. You'll learn to find those errors too after you've done them thousands of times like me :)