Thursday, 18 February 2021

JS: FUNCTION ONLOAD

  <script>
    function newContent() {
      document.open();
      document.write("<h1>Out with the old, in with the new!</h1>");
      document.close();
    }
  </script>

<div onload="newContent();">
  <p>Some original document content.</p>
</div>