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
Modestas Kiudulas
1,590 PointsAm i missing something?
For some reason this code is not running
var randNo = Math.floor(Math.random() * 6 ) + 1; var guess = prompt("Guess The Number between 1 and 6"); if (parseInt(guess) === randNo) { document.write("You Guessed it. it's " + randNo); } else { document.write("try again! " + "it's " + randNo); }
Modestas Kiudulas
1,590 PointsThanks, i guess my work space was glitched or something
1 Answer
Munira Hadi Omar
5,287 PointsHello Modestas Kiudulas There is nothing wrong with your JavaScript Code . I just checked it and it worked. So jsut make sure you attach the javascript file in your html file properly
Christian Mangeng
16,598 PointsChristian Mangeng
16,598 PointsHi Modestas,
I just checked your code and it should work. Make sure to include the script in the html code.