Mar 23 2024
·
1 min
·
JavaScript
Vanilla JavaScript equivalent of jQuery's $.ready()
jQuery’s $.ready() function is used to execute a function when the DOM is fully loaded. The equivalent in vanilla JavaScript is to use the DOMContentLoaded event.
document.addEventListener('DOMContentLoaded', function(){
// your code goes here
}, false);