# What is $(document).ready() equivalent in JavaScript? JavascriptWeb DevelopmentFront End Technology In jQuery, if you want an event to work on your page, you should call it inside the$(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.

$(document).ready(function() { alert(“Document loaded successful!"); }); ## Example In JavaScript, to achieve the same result like$(document).ready, try the following code −

<html>
<body>
<script>
var loader = setInterval(function () {
</html>