if page loaded javascript code example
Example 1: js on page loaded
window.onload = function() {
yourFunction(param1, param2);
};
Example 2: how to check if page is loaded in javascript
<body onload="onload()">
<div>
<p>TEXT</p>
</div>
</body>
<script>
function onload(){
console.log("Window Has Been Loaded!")
}
</script>