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 trialjrmcintyre
4,892 PointsThe prompt won't pop up
For some reason the prompt won't show up please help!
My code-----------------------------------------------------------------------------------------------------var questions = 3; var questionsLeft = ' [' questions + ' questions left'; var adjective = prompt('Please type an adjective' + questionsLeft); questions -= 1; questionsLeft = ' [' questions + ' questions left'; var verb = prompt('Please type a verb' + questionsLeft); questions -= 1; questionsLeft = ' [' questions + ' questions left'; var noun = prompt('Please type a noun' + questionsLeft); alert('All done. Ready for the message?'); var sentence = "<h2>There once was a " + adjective; sentence += ' programmer who wanted to use JavaScript to ' + verb; sentence += ' the ' + noun + '.</h2>'; document.write(sentence);
4 Answers
Matthew Coykendall
3,512 PointsYo James, var questionsLeft = ' [' questions + ' questions left'; \n That's what your code looks like. It should look like this. var questionsLeft = ' [' + questions + ' questions left]'; Hope that helps.
Michal Rydlo
14,982 PointsThe lines where you assign the questionsLeft variable are missing a plus operator, it should be:
var questionsLeft = ' [' + questions + ' questions left]';
Unsubscribed User
427 PointsCan you edit you post to put your code in a block of code.
Example :
```javascript //Start of your block of code in JavaScript.
// Your code goes there !
``` // End of your block of code.
jrmcintyre
4,892 Pointsdude i want a fix not a sugestion
javascript //Start of your block of code in JavaScript.
// Your code goes there !
// End of your block of code.
Unsubscribed User
427 PointsYes, but if you want help could you make your problem easier to understand !
jrmcintyre
4,892 Pointsthe prompts are not showing up please help