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)
![Angela Pintus](https://secure.gravatar.com/avatar/ee7a53e68e9756169a4b63826307a24f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angela Pintus
400 PointsCode does not work.
I have understood the instructions but code does not work! I have written the same code of the professor! In the js file: alert("Let's do some math!"); var firstNumber = prompt("Enter a number: "); firstNumber = parseFloat(firstNumber); var secondNumber = prompt("Enter a number: "); secondNumber = parseFloat(secondNumber); var message = "<h1>Math with the numbers " + firstNumber + " and " + secondNumber + "</h1>"; document.write(message);
In the html file: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Practice JavaScript Math</title> <link href="css/styles.css" rel="stylesheet"> </head> <body> <script src="js/math.js></script> </body> </html>
![Kevin Gates](https://secure.gravatar.com/avatar/e6d902128dd45e6d463bc4f42dee5fcd?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kevin Gates
15,053 PointsNext time, please use the Markdown cheatsheet to make your code more readable, like this:
JS File
alert("Let's do some math!");
var firstNumber = prompt("Enter a number: ");
firstNumber = parseFloat(firstNumber);
var secondNumber = prompt("Enter a number: ");
secondNumber = parseFloat(secondNumber);
var message = "<h1>Math with the numbers " + firstNumber + " and " + secondNumber + "</h1>";
document.write(message);
HTML File
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Practice JavaScript Math</title>
<link href="css/styles.css" rel="stylesheet">
</head>
<body>
<script src="js/math.js></script>
</body>
</html>
2 Answers
![Angela Pintus](https://secure.gravatar.com/avatar/ee7a53e68e9756169a4b63826307a24f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angela Pintus
400 PointsI posted my code. I want check if my code works first, then I'll add the rest of the code to complete the challenge.
![Angela Pintus](https://secure.gravatar.com/avatar/ee7a53e68e9756169a4b63826307a24f?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angela Pintus
400 PointsIt works, there was a problem in html file. I have re written the script in the html file. That's weird!
![KRIS NIKOLAISEN](https://secure.gravatar.com/avatar/65d74a723997b41a80d2d909c6e06960?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
KRIS NIKOLAISEN
54,969 PointsYou are missing a closing quote here:
<script src="js/math.js>
in your html. Should be
<script src="js/math.js">
![Angela Pintus](https://secure.gravatar.com/avatar/ee7a53e68e9756169a4b63826307a24f?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angela Pintus
400 PointsWhere? I put the closing quote, it's an error of workplace, it does not work well.
KRIS NIKOLAISEN
54,969 PointsKRIS NIKOLAISEN
54,969 PointsCan you post your code?