External JavaScripts
Scripts can also be placed in external files. External files often contain code to be used by several different web pages.External JavaScript files have the file extension .js.
To use an external script, point to the .js file in the "src" attribute of the <script> tag:
Example
<!DOCTYPE html>
<html>
<body> <script src="myScript.js"></script>
</body>
</html>
<html>
<body> <script src="myScript.js"></script>
</body>
</html>
No comments: