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

This 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.

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>
      ```
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 + "!")

Way 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

I think you forgot the semicolons and the closing </h2> element.

Hi 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>");
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>");

There, fixed it. Thank you so much Adam!

Now it is working? Happy coding!

start with "```javascript", then the page knows how to style it :)