A simple conceptual question

A simple conceptual question

Hello everyone,
I am beginner of jqQuery and I would like to know the following:

When using $(document).ready() function is it necessary to place it in between the head tags? Can't we put it, for example, within the body of a document.

When I write my own examples I always put this function at the end of body (just before </body>) and they work fine. Can anyone clarify it?

Regards.