External JavaScript part 2

External JavaScript
30
2/3













External JavaScript
To use an external script, put the name of the script file in the src (source) attribute of the <script> tag.
Here is an example:<html>
<head>
<title> </title>
<script src="demo.js"></script>
</head>
<body>
</body>
</html>
Your demo.js file includes the following JavaScript:alert("This is an alert box!");
External scripts cannot contain <script>tags.
Comments
Post a Comment