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 trialZeke Swanson
Web Development Techdegree Student 8,301 PointsWhy 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;
2 Answers
Aissa Toumi
1,419 Pointsyou forgot the backtick at the beginning of the message variable
Zeke Swanson
Web Development Techdegree Student 8,301 PointsI was finally able to figure it out. I apologize for the late reply. Thank you both for helping me out with this!!
jb30
44,807 Pointsjb30
44,807 PointsIn 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
toinnerHTML
or create a paragraph in main and usetextContent
on it instead, but that shouldn't affect getting the prompts.