What is the difference between $(document).ready() and $(window).load() function in jQuery?

1 Answers
Answered by suresh

```html

jQuery Interview Question: Difference between $(document).ready() and $(window).load() functions

Difference between $(document).ready() and $(window).load() function in jQuery

$(document).ready() function in jQuery is executed when the DOM is fully loaded while $(window).load() function is executed when all the assets (such as images) are loaded.

It is recommended to use $(document).ready() for most jQuery functions, as it allows the code to run as soon as the DOM is ready. $(window).load() should be used when you need to wait for all assets to be loaded before executing specific code.

```

Answer for Question: What is the difference between $(document).ready() and $(window).load() function in jQuery?