document.onload window.onload code example
Example 1: document load javascript
window.onload = function() {
// Code here
}
Example 2: javascript onload
<body onload="myFunction()">
window.onload = function() {
// Code here
}
<body onload="myFunction()">