Declaring a Function in the 'head' Block
<html> <head> <title>JavaScript Unleashed</title> <script type="text/javascript"> <!-- function defaultColors() { document.writeln("Inside of defaultColors()"); document.fgColor = "black"; document.bgColor = "white"; } // --> </script> </head> <body> <script type="text/javascript"> <!-- document.writeln("Functions are scripts just waiting to run!"); defaultColors(); document.writeln("All done."); // --> </script> </body> </html>