Example of Including Javascript Internally in the Head Tag

This example includes internal Javscript code within the <head> element.

Notice that the "alert" box showed up before any of this content on the page had been displayed in the browser. This is because any code in the <head> section of the XHTML document is interpreted by the browser before anything in the <body>