Which function would you call to wait until the DOM has finished loading code example
Example 1: jquery doc ready
// A jQuery( document ).ready() block.
jQuery( document ).ready(function() {
console.log( "ready!" );
});
Example 2: js dom ready function
<!doctype html>
<html>
<head>
</head>
<body>
Your HTML here
<script>
// self executing function here
(function() {
// your page initialization code here
// the DOM will be available here
})();
</script>
</body>
</html>