not always what we want. Sometimes we want to execute a script when a page loads, or at a later
event, such as when a user clicks a button. When this is the case we put the script inside a
function, you will learn about functions in a later chapter.
Scripts to be executed when they are called, or when an event is triggered, are placed in
It is a good practice to put all your functions in the head section, this way they are all in one
place and do not interfere with page content.
Scripts placed in the body section are often used to display page content while the page
You can place an unlimited number of scripts in your document, and you can have scripts in both
the body and the head section at the same time.
Note: External script cannot contain the <script></script> tags
To use an external script, point to the .js file in the "src" attribute of the <script>
Note: Remember to place the script exactly where you normally would write the script
Your Query was successfully sent!