Jquery Document Ready Function

Document ready function is used to run jquery code after the document is loaded .Since some actions can fail if the functions are run before the document is fully loaded.


i) Trying to get the size of an image that is not loaded.
ii) Trying to hide an element that does not exist.
Syntax $(document).ready(function(){
    //put your code here
});
or
$(function(){
    //put your code here
}
example:
			
			
			
Not loaded yet
Demo:
Not loaded yet
After editing Click here:
Output: