The click function can be placed anywhere and have the same effect on the selection ($).
The selection function needs to be placed in such a way that it can select the nodes necessary. If the script tag comes before the content being selected in the DOM tree, you'll need to wait for the document to be ready or the window to have finished loading before the selection will succeed.
The following will work:
JS
$('#foo').click(...);
HTML
<div id="foo"></div>
<script src="location/script.js"></script>
But if you change the HTML around, this wont work:
<script src="location/script.js"></script>
<div id="foo"></div>
When the script is executed, the element with an id of foo doesn't exist yet. Which is why you typically wrap event handlers in the document ready event callback.