to include javascript from a file in a web page you need to code code example
Example: how to write code in external javascript file
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}