I have something simple. I have an html file and JavaScript file. In the JavaScript file the simple alert()
function is called but, it does not work!
I wrote a second line in the JavaScript file to make sure I was not giving the incorrect path console.log()
and it works as expected.
HTML:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
</head>
<body>
<div id="container">
</div>
<script src="functionality.js"></script>
</body>
</html>
In external JavaScript file:
alert('hello'); // does not get executed
console.log( 'hello' ); // gets executed
Why this does not work?