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

Tom Pieter
Tom Pieter
65 Points

says i didnt call the alert function within the script.

Not sure what i did wrong here, it says the alert function isnt placed within the script.

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">
alert("Warning");
</script>
</body>
</html>
Andrew Rady
Andrew Rady
20,880 Points

Remove the src,

<script src="scripts.js">
alert("Warning");
</script>

You don't need too have a source tag in there if you are going to run java script on the html page

1 Answer

Hey Tom,

Remove the src attribute from your script tag. There's no reason to have it for this challenge.

You should simply have:

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