Many of you might be wondering that way do we always use our javascript inside $(document).ready() in this Post i will tell you why do we use it and what if we don't write our script inside $(document).ready() function