1jQuery offers several ways to attach a function that will run when the DOM is ready. All of the following syntaxes are equivalent:
2
3$( handler )
4$( document ).ready( handler )
5$( "document" ).ready( handler )
6$( "img" ).ready( handler )
7$().ready( handler )