onload
attribute is seen .But it is limited only single function. First thing, whenever using jQuery to manipulate the web page, it is a good practice to wait until the document ready event has fired before working with the document page. The document ready event tells that the HTML DOM page is now ready. So one can manipulate HTML elements without worrying.
jQuery document ready event keeps the code from running before document finished loading and it is a decent practice to wait for the document till it is loaded completely. document
object. The$
function returns enhanced version of document
object and it has a ready()
method with anonymous function.ready()
method, one can execute all the jQuery and JavaScript code what they need, in order to enhance the HTML elements of the DOM.