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 trialAgnes Caringal
6,239 PointsOpen an alert dialog with the message 'Warning!' What's wrong with my JavaScript code?!
<script> alert("Warning!"); </script>
<!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>
<script>
alert("Warning!");
</script>
</body>
</html>
3 Answers
Agnes Caringal
6,239 Pointsok, sir, thank you so much
Ryan Field
Courses Plus Student 21,242 PointsHi, Agnes. The alert dialog inside your
<script>
tags is fine, but the challenge may be failing because you misspelled src
in the previous script tag as scr
.
Ryan Field
Courses Plus Student 21,242 PointsOh, I see what's wrong, I think. You have this:
<script scr="scripts.js"></script>
which you don't need. It's fine to have it in an actual website, but for this challenge, it's unnecessary.
Agnes Caringal
6,239 Pointsah, but that's the answered for the 1st challenge
Ryan Field
Courses Plus Student 21,242 PointsThe first part of the challenge is just to put a pair of script tags inside the body. You don't need to put anything in them, just this:
<script>
</script>
The second part is where you add your alert dialog:
<script>
alert("Warning!");
</script>
Ryan Field
Courses Plus Student 21,242 PointsRyan Field
Courses Plus Student 21,242 PointsYou're most welcome! Happy coding! :)