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 trialRyan Clark
2,000 PointsWhy is this not working?
This works when i press preview. I've tried restarting the browser, signed out. Yet it still won't work. I have continued on with the rest of the course but I'm just hoping someone can have a look and se if there is anything I am missing.
var isAdmin = false;
var isStudent = true;
if ( isAdmin ) {
alert('Welcome administrator');
} else if (isStudent) {
alert('Welcome student');
}
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
1 Answer
Steven Parker
231,269 PointsI can confirm that this code passes the challenge if I just paste it in. Your code is correct!
If a browser restart didn't help, you might try a machine reboot. Then you may want to contact the Support folks.