0
what is the difference between document.write("<h1>hello world</h1>"); and <h1>hello world </h1>
3 Respuestas
+ 4
We use document.write to output any text to HTML page using javascript. Anything written inside,will be rendered in the same way as the normal HTML text will be.
+ 3
The first one is printed using JavaScript. You wont need to do that unless you're practicing or it's part of a JavaScript application or something similar.
The second one is just plain HTM and that's how you would usually do it.
+ 1
thank you