Generally, functions should be placed in the <head> section of the HTML code. Although JavaScript code can be placed anywhere inside the <html> and </html> tags, placing them in the head section ensures that they will be fully loaded before they are called to execute. When a browser loads a page, it will begin displaying the page while still in the process of downloading it. In some instances, it is possible that a user's action might trigger a call to a function that hasn't yet been fully downloaded, causing an error and making you, the programmer, look bad.