I\'m new to Jquery. See an example at http://w3schools.com/jquery/tryit.asp?filename=tryjquery_hide_p. Here, clicking \'Click Me\' button the text change. My question is why the
Yes, if you didn't wrap this code in the $(document).ready() handler, the objects wouldn't exist because the DOM isn't loaded.
$(document).ready()
This is a simple test to ensure that the DOM is ready, before invoking methods on its elements.