What is the exact use of $(document).ready() in jQuery and can we have two $(document).ready() in a webpage?
use of Document.ready in Jquery
At times you need scripts to run on page load. But there might be some elements that are not completely loaded while executing your script. To make it safe to run, we use $(document).ready(function { /* to do here */}) or short hand $(function { /* to do here */});
can we have two document.ready in a webpage
Yes, you can have multiple.