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 trialCalvin Secrest
24,815 PointsInside the script tags, write a function that will open an alert dialog with the message 'Warning!'
I cant find out if my script is set up properly?
<!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>
7 Answers
Mikkel Rasmussen
31,772 Points<script>
alert("Warning!");
</script>
Dakota Smith
4,766 Points<body>
<script>
alert("Warning!");
</script>
</body>
knowledge tirivanhu
10,125 Points<script> alert("Warning!"); </script>
Learning coding
Front End Web Development Techdegree Student 9,937 PointsAfter writing this code the folowwing happens:
A grey box (message) appears with text in it: An embedded page on preview.treehouse-challenges.com report the following: Warning!
When I click on ok in the the textbox mentioned above it says that task one doesn't pass.
What is happening here and how can I pass the task?
Averi Dickerson
1,922 PointsThe script is correct, you just need to remove the semicolon at the end. Hence: alert("Warning!");
Change to: alert("Warning!")
August Oliver
5,934 Points<body> <script> alert("Warning!"); </script> </body>
Mustafa Abrams
10,288 Points<script> alert("Warning!"); </script>
Mikkel Rasmussen
31,772 PointsMikkel Rasmussen
31,772 PointsYou don't need to make src to a javascript file.
Calvin Secrest
24,815 PointsCalvin Secrest
24,815 PointsThe code text in index.html mention is I put it that way then task 1 is wrong and no longer passing. Where inside the code text does this script is place?