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 trialEmmanuel Onyeoziri
185 Pointsinside the script tag
how do i write a function that will open an alert dialog with message warning!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body> <script> </script> </body>
<script> 'alart("warning")
</html>
1 Answer
Christopher Jr Riley
35,874 PointsActually, you have all the code that you need in order to pass the challenge! You just need to do some cleanup.
- On the part where it says "<script> 'alart("warning")", just remove "<script>". Remove the apostrophe as well (This: ')
- The line that says "<body> <script> </script> </body>": put each of the tags into separate lines.
- Remember that in order for the JavaScript code to work, it will need to be inside the "script" tags. With that in mind, put "alart("warning")" in between the "<script> </script>" tags.
- Finally, you misspelt "alert". Just change the second "a" with an "e". It should look something similar to this:
alert('Warning!')
In the end, it should look something like this:
<!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>
Hope this helps!
Emmanuel Onyeoziri
185 PointsEmmanuel Onyeoziri
185 Pointsthank you it worked