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 trialTed Staggs
Courses Plus Student 241 PointsWhat`s the difference between alert and document.write ?
Thanks
3 Answers
Leandro Botella Penalva
17,618 PointsHi Ted,
Alert shows an alert box to the user with a message that the user has to press "Ok" to continue using the website.
The document.write prints something directly to the website and don't require user interaction.
Christopher Debove
Courses Plus Student 18,373 PointsLeandro told it all. The best way for you to see the difference is to test it. Open a workspace or try it on your browser console.
Ted Staggs
Courses Plus Student 241 PointsThanks
Ted Staggs
Courses Plus Student 241 PointsTed Staggs
Courses Plus Student 241 PointsThank you very much