Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Write Another Program

Open an alert dialogue message

The task is asking me to add alert(‘Warning) inside of the </script> Tags. I did and it still has changed anything.

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="script.js" 
          alert="Warning">
  </script>

</body>
</html>

2 Answers

  <script src="script.js" >

alert("Warning"); //try putting it inbetween script tags. alert(); is a javascript built in function. functions are called with (); following the name. 

  </script>
Steven Parker
Steven Parker
210,472 Points

There are two kinds of "script" tags. One kind has a "src" attribute that names an external file to be loaded and run. That kind should not have any code between the start and end tags.

The other kind does have code between the tags, but it does not have a "src" attribute in the start tag. That's the kind you need for this particular challenge. Then use JavaScript syntax inside the tags for calling the function, and be sure the code is between the tags and not inside the start tag:

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