Day 6 💻

Today i am talking about:

External JavaScript

Scripts can also be placed in external files:

External file: myScript.js

function myFunction() {

 document.getElementById("demo").innerHTML = "Paragraph changed.";

}

External scripts are practical when the same code is used in many different web pages. 

JavaScript files have the file extension .js.

To use an external script, put the name of the script file in the src (source) attribute of a <script> tag:

Example

<script src="myScript.js"></script>


Comments

Popular posts from this blog

Day 2 Talking about computer science 💻

Day 5💻

Day 12 “C comments”