JavaScript JavaScript Basics Hello, JavaScript! Add JavaScript to HTML

Kamarky Jimenez
Kamarky Jimenez
3,754 Points

Can't get second java command from video to run.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JavaScript Basics</title> <link href="css/style.css" rel="stylesheet"> <script src="js/script.js"></script> </head> <body> <main> <h1>Hello, JavaScript!</h1> <script>alert(“hello another message from html file”);</script> </main> </body> </html>

1 Answer

Hi Kamarky!

I did some testing. It seems that you are using unusual quotes (not normal double quotes) and created an "unexpected token" error.

You are using:

alert(hello another message from html file ); // &ldquo; &rdquo;

And not:

alert("hello another message from html file"); // &quot; &quot;

(See, they even print out different in the JS markup!?!)

Also, I would put the alert script outside main, just before the closing body tag...

I hope that helps.

Stay safe and happy coding!