https://www.w3schools.com/tags/ev_onload.asp
Example
Execute a JavaScript immediately after a page has been loaded:
<body onload="myFunction()">
Definition and Usage
The onload attribute ...
<html>
<head>
<title>Introduction to the DOM</title>
<script>
// We can't manipulate the DOM until the document
// is fully loaded
window.onload = fu...