my webpage have following code :\[code\]<html><head> <title>This is test Page</title> <script language="javascript" type="text/javascript"> document.getElementById("msg1").innerHTML = document.URL.toString(); </script></head><body> <div class="sss"> <p id="msg1"></p> </div></body></html>\[/code\]as you now The time the script executes the div doesn't exist but i want put my java code only in HEAD tag and i wont put it in middle of HTML code.but this code only work when i put SCRIPT tag after DIV tagi use VS2010 and firefox 19.0.1is there anyway to put code in HEAD tag??