External JavaScript part 2

JavaScript Tutorial
Overview
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

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2