how to do a javascript file code example
Example 1: calling javascript file in html
<script type="text/javascript" src="yourfile.js"></script>
Example 2: how to create js code
<!--just open a file with the ending of ".js"
example: myFirstJS.js
an other option is to write this sentence on HTML document:
-->
<script type="text/javascript">
//write here your code
</script>