Daniel Valland Daniel Valland - 3 months ago 7
HTML Question

Javascript - document.write prevents other content

I have the code

<body>
<script>document.write("<div>hello world </div>");</script>
<h1>hello></h1>
</body>


However, the h1 tag does not show...

Answer

It works, Close your </h1>

<body>
<script>document.write("<div>hello world </div>");</script>
<h1>hello</h1>
</body>

Comments