Java Script


JavaScript Tutorial


Admission Enquiry Form


External JavaScript

External JavaScript provides code re usability because single JavaScript file can be used in several html pages.The extension of external JavaScript file is (.js). This (.js) file is embedded into that (.html) file where you want to use the external JavaScript code.




external.js

function display()
{
alert("Welcome to Compuhelp");
}




external-test.html

<html>
<head>
<title>Example of external javascript</title>
<script type="text/javascript" src="external.js">
</script>
</head>
<body>
<form>
<input type="button" value="click" onClick="display()"/>
</form>
</body>
</html>