0

I have a Footer which I am including on all my pages by JS:

includeHTML("footer.html", document.querySelector(".footer"));

But in that, I want the simple copyright rule:

        <p>Copyright &copy; <span id="getDate"></span> NameHere All Rights Reserved</p>
        <script type="text/JavaScript"> let theDate = new Date().getFullYear(); document.getElementById("getDate").innerHTML = theDate;
        </script>

I can get this to work on a standard page in JSBin or similar and there appears nothing wrong with the logic. But it won't run in the "includeHTML" file when I run the page.

So, how do you includeHTML with JS in the included HTML file?

Paul Davis
  • 495
  • 4
  • 14
  • Does this answer your question? [Include html in another html file](https://stackoverflow.com/questions/38837835/include-html-in-another-html-file) – Emre Nov 19 '22 at 10:43
  • I don't think so, because my includeHTML is working perfectly, but the script on the included file aren't. – Paul Davis Nov 19 '22 at 10:45

0 Answers0