<script type="text/javascript">
<!--
//-->
You can also put your JavaScript in another file and use the script tag to read it in. The file just has to have an accessible url. This can help with both organizing and hiding your commands from browsers that don't understand the script tag. In order to do this you use the src attribute. For example:
<script type="text/javascript" src="http://www.baumler.com/javascript/file.js" charset="en" defer="defer"></script>
If you are putting this in an XHTML document, you can use /> to close the script tag, rather than immediately following it with </script>, but this is not valid HTML and may or may not work depending on the browser.
You will notice I added two additional optional attributes to the example above. The charset attribute is used to define the charset of the data between the script tags. The defer="defer" is the only valid use of the defer element. It tells the browser that the rest of the page does not depend on the contents of this file in order to load and therefore the browser can defer loading the file or load it simultaneously with the rest of the page. This would be useful, for instance, if you were loading functions that would be called in response to user actions.