Answers for "how to check if dom is loaded in javascript"

1

dom is loaded

document.addEventListener('DOMContentLoaded', (event) => {
    console.log('DOM fully loaded and parsed');
});
Posted by: Guest on June-25-2020
1

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>
Posted by: Guest on April-13-2021

Code answers related to "how to check if dom is loaded in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language