Using External JS file

Step -1 Open Notepad, paste the following code in it as save it as include.js



document.write('hello')



Step -2 Close the notepad.

Step -3 Open Notepad, paste the following code in it and save it as test.html



<html>
<head>
<title>Using External JS File</title>
<script language="JavaScript" type="text/javascript" src="include.js"></script>
</head>
<body>
</body>
</html>




Step -4 Close the notepad.

Step -5 Open the test.html in Internet Explorer or FireFox.

Simple as that.

You can use include.js within "body" tags of test.html where-ever you need it. For example, remove everything from source of test.html and paste the following in it and save. Refresh the page.



<html>
<head>
<title>Using External JS File</title>
</head>
<body>This explains why the dog tries to comfort its owner when it sees it sad or worried, or that it will conform with staying home when the owner doesn't feel like going out.The dog always adapts itself to its owner's habits.<br><br><script language="JavaScript" type="text/javascript" src="include.js"></script>
<br><br>Except in vary rare cases, they don't demand any special privileges and remain very faithful to the people that surround it.</body>
</html>



Whatever you will add in include.js file, it will appear in test.html . For example, open include.js using Notepad and paste the following in it and then refresh test.html



document.write('hello<br><br><a href="http://www.blogger.com/anylink.html">this is a link test</a>');