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

Jan Andraczko
Jan Andraczko
3,582 Points

Running java script (one command not executed)

Hi

I just started Basis of JavaScript and wrote this simple code:

alert("Hello from Treehouse"); document.write("<h1>Welcome to JavaScript Basics</h1>"); alert("Thanks for visiting");

The problem that I have is that when I am running it on Chrome browser in display 1st alert box, then the second alert box and at the end Heading 1.

Can anybody explain why text is not displayed after the first alert window, as it is in video?

Thank you

Jan