I have the following test.html file and from it I'm trying to call sayHello() from the myjslib.js file. sayHello simply prints "Hello!" to the console but nothing is printing. How do I call sayHello from the test.html file? This question may seem like a duplicate of this question. But, that question is addressing the use of script code inside a script tag that has a src attribute. I now have the function call in a separate script tag yet they still does not launch.
HTML body
<body>
<script src="myjslib.js"></script>
<script>
sayHello();
</script>
</body>
These are the functions in the JavaScript file
function sayHello() {
console.log("Hello!");
}
function sayGoodbye() {
console.log("Goodbye!");
}