You can store the JavaScript code in a separate file and then refer to it as follows:
<SCRIPT SRC="../javascripts/myscript.js"> </SCRIPT>
To hide script from showing up on older browsers as text, type
<!-- the script //-->
If you want to display text to replace script on browsers without JavaScript capability, type
<NOSCRIPT> text you want display in place of the JavaScript </NOSCRIPT>
Other JavaScript examples here