Embedding a JavaScript Function
<html> <head> <title>JavaScript Unleashed</title> <script type="text/javascript"> <!-- function displayMessage() { document.write("JavaScript functions<br>"); } // --> </script> </head> <body> <script type="text/javascript"> <!-- document.write("Calling a JavaScript function...<p>"); displayMessage(); document.write("</p>Done. "); // --> </script> </body> </html>