javascript code for when the window onload code example
Example 1: js document onload
//use
window.onload=()=>{};
Example 2: javascript onload
<body onload="myFunction()">
//use
window.onload=()=>{};
<body onload="myFunction()">