Write information to HTML document.

January 29, 2025 No Comments » Hits : 450





JS Code :

<html>
<body>
<h1>My First JS Program</h1>
<script type="text/javascript">
document.write("<p>" + Date() + "</p>");
</script>
</body>
</html>

Output :

  • document.write() will overwrite complete page.
  • Each time when page is reloaded JS script gets called.
  • Complete page is overwritten each time when page gets loaded.

Incoming search terms: