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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Nicole DeRosie](https://secure.gravatar.com/avatar/e770416fe508f9552270acc1feec6889?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nicole DeRosie
245 PointsHow do I 'call alert' I am a little confused about this part
Hi Im having a hard time understanding what they mean when they say I did not call alert. Thank you!!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script>
document.write("Warning!");
</script>
document.write("Warning!");
</body>
</html>
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsWhen you "call" a function, you put the function's name followed by a pair of parentheses. If the function requires any arguments (as this one does), they go inside those parentheses. The code here is calling "document.write" instead of "alert".
Also, you only need to write your code one time, and only between the "script" tags.
![Nicole DeRosie](https://secure.gravatar.com/avatar/e770416fe508f9552270acc1feec6889?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nicole DeRosie
245 PointsI have removed the unnecessary second line. It now looks like this. where am I going wrong? What am I missing? <script> document.write("Warning!"); </script>
![Nicole DeRosie](https://secure.gravatar.com/avatar/e770416fe508f9552270acc1feec6889?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nicole DeRosie
245 PointsNVM, I got it. Thank you. Except I didn't have to write document.write. Just alert
![frankgenova](https://uploads.teamtreehouse.com/production/profile-photos/5848752/micro_Frank_J_Genova_face.jpg)
frankgenova
Python Web Development Techdegree Student 15,616 Points<!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>
frankgenova
Python Web Development Techdegree Student 15,616 Pointsfrankgenova
Python Web Development Techdegree Student 15,616 Pointscheck out:
https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
Code answer below