<!DOCTYPE HTML>
<html>
<head>
<script>
document.write("TEST1")
document.getElementById("demo").innerHTML="TEST2"
document.write("TEST3")
</script>
</head>
<body>
<p id="demo">TO_BE_REPLACED</p>
</body>
</html>
Here is the output: TEST1
TO_BE_REPLACED
It seems the javascript executing stopped at document.getElementById("demo").innerHTML="TEST2"
. Why doesn't it execute?