Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Introducing Conditional Statements

I changed it but its still sticking

I think there could be something wrong with the checker? nothing is working

app.js
var answer= prompt("what is the best programming language?")
if answer === "Javascript"; {
  document.write <p> ("You are correct."); </p>)
    }
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>

3 Answers

Adam Beer
Adam Beer
11,314 Points

Just a few typo. You forget use the brackets of if() statement. Delete your semicolon after the "JavaScript". And again, I wrote to you, you shouldn't use document.write(), you want to use the alert() dialog. And you shouldn't use the <p></p> elements. Please focus on the questions. Just do what the task asks from you and don't do nothing else.

I will adam. thank you. right now i'm going against time to get the rest of the prerequisites for code Louisville to be considered. this is my first attempt at programming with these languages. most of everything i've done before were building databases with FoxPro. I really appreciate all the help.

Adam Beer
Adam Beer
11,314 Points

If you do not know the answer use the forum and we help you. Please focus on the questions. If you do anything else you will not let go the task.

Now you found the right way?

var answer = prompt("what is the best programming language?"); if (answer === "Javascript"){ document.write("<p>You are correct.</p>") }

Try this.

Adam Beer
Adam Beer
11,314 Points

First, this isn't the right way. Second, we don't write the good code. No one learns from the finished code.

Really? It should work. What do you want to do ?