Now when we know how usefull JavaScript can be, I'll show you how can you put your Script in External file! This is very good practise, because your code is more readable, smaller and more professional. When you will have couple of scripts, you can call it in one line! Not as usually copying the whole code on the page :) To add external script file to our website, we need to use src: atribute
< script type="text/javascript" src="file_with_script.js">< /script>
Dont forget: The external script file cannot contain the < script > tag.
TIPS:
Use external JavaScript files when you want to use the same script on many pages, but don't want to have to rewrite the code on every page! Use external JavaScript files for including both types of scripts: the type that you place in the head (functions) and the type you place in the body (scripts you want to run when the page loads). Be sure that your JavaScript files (.js) do not include the < script > tag. They should only contain HTML commenting and JavaScript code -- nothing more!