JS

HOW TO RUN JAVASCRIPT AFTER PAGE LOAD

window.addEventListener("load", () => {   DO SOMETHING });

LOAD EVENT LISTENER

01

<body onload="DOSOMETHING();">   <h1>Hello World!</h1> </body>

PAGE ONLOAD

02

<script src="SCRIPT.JS" defer> </script>

DEFER LOADING

03

<body>   <h1>Hello World!</h1>   <script src="SCRIPT.JS"></script> </body>

SCRIPT AT BOTTOM

04