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

HTML

Need help making an alert box

Here is the code I have, and I cannot seem to open it in a web browser to see an alert pop up. I have saved it as an html file and I am using Chrome. Any suggestions to troubleshoot would be great!

<!doctype html>

<html lang="en">
    <head>
    <meta charset="utf-8">
    <title>My Page</title>
    <link rel=“stylesheet” type=“text/css” href=“application.css>
    <script type=“text/javascript”>
        alert(Hello World!);
    </script>
</head>
    <body>


    </body>

</html>

2 Answers

You're having quote-related issues.

  • Some of your quote characters seemed to have gotten mangled so re-type those
  • Missing close quote mark on application.css
  • In JavaScript strings need to be enclosed in quotes

Once I fixed those 3 issues it worked.

Thank you so much - that worked!

<script>
alert("Its working");
</script>