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
Ergin Tamano
Courses Plus Student 1,496 PointsThis is what I did!
var adjective = prompt("Please type an adjective."); var verb = prompt("Please type an verb."); var noun = prompt("Please type a noun."); alert("All done. Ready for the message?") document.write("<h2>There was once a " + adjective + " software developer who wanted to use JavaScript to " + verb + " the " + noun + "!")
I thought I did great just because I achieved the desired outcome. But after watching the solution video, what I did looked amateurish considering the amount of concatenation that I did to get the outcome.
I am really enjoying this lecture.
Antti Lylander
9,686 PointsWay to go! This is learning at it's best!
tip:
Code Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of >backticks, that'll help us with syntax highlighting.
```html <p>This is code!</p> ```
so, for javascript, you start with "```javascript"
4 Answers
Adam Beer
11,314 PointsI think you forgot the semicolons and the closing </h2> element.
Ergin Tamano
Courses Plus Student 1,496 PointsHi Adam,
Yes, it is working now.
Hi Antti,
Thanks for the tip!
var adjective = prompt("Please type an adjective.");
var verb = prompt("Please type an verb.");
var noun = prompt("Please type a noun.");
alert("All done. Ready for the message?");
document.write("<h2>There was once a " + adjective +
" software developer who wanted to use JavaScript to " +
verb + " the " + noun + "! </h2>");
Ergin Tamano
Courses Plus Student 1,496 Pointsvar adjective = prompt("Please type an adjective.");
var verb = prompt("Please type an verb.");
var noun = prompt("Please type a noun.");
alert("All done. Ready for the message?");
document.write("<h2>There was once a " + adjective +
" software developer who wanted to use JavaScript to " +
verb + " the " + noun + "! </h2>");
Ergin Tamano
Courses Plus Student 1,496 PointsThere, fixed it. Thank you so much Adam!
Adam Beer
11,314 PointsNow it is working? Happy coding!
Antti Lylander
9,686 Pointsstart with "```javascript", then the page knows how to style it :)
Adam Beer
11,314 PointsAdam Beer
11,314 PointsCode
Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.