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

JavaScript JavaScript Basics Working with Strings Variables and Strings Challenge Solution

Zeke Swanson
seal-mask
.a{fill-rule:evenodd;}techdegree
Zeke Swanson
Web Development Techdegree Student 8,301 Points

Why is my prompt box not showing up when I run the code?

Here is my code:

const adjective = prompt('Please Type an Adjective.'); const noun = prompt('Please type a noun.'); const verb = prompt('Please type a verb.');

const message = <p>The ${adjective}, looking ${noun} came in and ${verb} all the cookies.</p>`;

document.querySelector('main').innerhtml = message;

In Firefox, after the first prompt, I got a checkbox in the prompt window that said "Prevent this page from creating additional dialogs", which, if you check it, no longer allows the site to prompt the user. In Opera, I needed to reload the page to get the prompts. Have you tried reloading your page or testing your code in another browser?

You might want to change innerhtml to innerHTML or create a paragraph in main and use textContent on it instead, but that shouldn't affect getting the prompts.

2 Answers

you forgot the backtick at the beginning of the message variable