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 trialKim Dallas
11,461 PointsI changed it but its still sticking
I think there could be something wrong with the checker? nothing is working
var answer= prompt("what is the best programming language?")
if answer === "Javascript"; {
document.write <p> ("You are correct."); </p>)
}
<!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
11,314 PointsJust 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.
Kim Dallas
11,461 PointsI 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
11,314 PointsIf 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?
yi wu
9,238 Pointsvar answer = prompt("what is the best programming language?")οΌ if οΌanswer === "Javascript"οΌ{ document.write("<p>You are correct.</p>") }
Try this.
Adam Beer
11,314 PointsFirst, this isn't the right way. Second, we don't write the good code. No one learns from the finished code.
yi wu
9,238 PointsReally? It should work. What do you want to do ?
Adam Beer
11,314 PointsAdam Beer
11,314 PointsPlease check and read these links.
JavaScript if else and else if
HTML DOM write() Method
Window alert() Method
HTML JavaScript