I have a simple script that works when included in the html body. However, when running this from a relative path, and including the
<script type="text/javascript" src="simple.js"></script>
in either the header or bottom of the html file, the script will no longer run.
Can anyone point as to what I am missing ?
Thank you.
Script simple.js:
<script>
function firstFunction(){
var a = document.getElementById("firstInput").value;
if(! a){
alert("minimum input of 1 char required");
}else{
document.getElementById("firstOutput").innerHTML=a;
}
}
function secondFunction(){
var b = document.getElementById("secondInput").value;
if(!b){
alert("minimum input of 1 char required");
}
document.getElementById("secondOutput").innerHTML=b;
//document.getElementById("secondOutput").innerHTML = "updated!";
}