Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

jang walia
7,717 Pointshtml lagging behind
when i run my code ,the javascript alert and prompt appears on screen leaving sceen blank in the back. the background image is not shown while the javascript is running..?? i have built a simple quizz programme so that why i have added javascript .
kindly help

Ross King
20,680 PointsHi jang walia ,
Can you provide the code so other students can help you. eslam said is most likely correct and his answer should fix your problem.

Gari Merrifield
9,558 PointsThere's some info in this article, and some corrections in the comments : https://javascript.info/onload-ondomcontentloaded
And there is an interesting conversation on the topic here on the community as well : https://teamtreehouse.com/community/why-i-can-see-the-result-of-documentwrite-only-after-all-the-prompts-and-alert-messages-disappear
Hopefully some of that helps..
eslam said
Courses Plus Student 6,734 Pointseslam said
Courses Plus Student 6,734 PointsBecause probably you have your script tag inside the head so instead put your script tag before the ending on the body tag like so :