Why is my external script not included and how to change inner HTML

107 views Asked by At

I am working on a basic website and I'm trying to use JS to make "video-navigator"

The thing is:

  • my external script is not being included

So this is my HTML for including my JS

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

Click here for the entire site

1

There are 1 answers

1
Dave Walker On BEST ANSWER

You have a few issues with this. Firstly you're trying to set the innerHTML incorrectly which is failing. Secondly you're using a reserved word for a function (new). In the pop function I've commented out your incorrect bit and added a correct version. I've also renamed your function to new_renamed so that it works.

alert("working");
function pop()
{
    alert("INVALID INPUT");
    //HTMLDivElement("content") innerHTML = "";
    document.getElementById('content').innerHTML = '';
}
function old()
{
    alert("INVALID INPUT");
}
function new_renamed()
{
    alert("INVALID INPUT");
}

Above will log.